projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20070322-1-src
[rocksndiamonds.git]
/
src
/
libgame
/
misc.c
diff --git
a/src/libgame/misc.c
b/src/libgame/misc.c
index 7a780511fde0a6743c6c00c74cede00d30dde723..25df21ca234f94b882d895c1b59c2ffd32efff84 100644
(file)
--- a/
src/libgame/misc.c
+++ b/
src/libgame/misc.c
@@
-584,6
+584,14
@@
boolean strEqual(char *s1, char *s2)
strcmp(s1, s2) == 0);
}
strcmp(s1, s2) == 0);
}
+boolean strEqualN(char *s1, char *s2, int n)
+{
+ return (s1 == NULL && s2 == NULL ? TRUE :
+ s1 == NULL && s2 != NULL ? FALSE :
+ s1 != NULL && s2 == NULL ? FALSE :
+ strncmp(s1, s2, n) == 0);
+}
+
/* ------------------------------------------------------------------------- */
/* command line option handling functions */
/* ------------------------------------------------------------------------- */
/* command line option handling functions */
@@
-1829,7
+1837,7
@@
int get_parameter_value(char *value_raw, char *suffix, int type)
string_has_parameter(value, "crossfade") ? FADE_MODE_CROSSFADE :
FADE_MODE_DEFAULT);
}
string_has_parameter(value, "crossfade") ? FADE_MODE_CROSSFADE :
FADE_MODE_DEFAULT);
}
- else if (strEqual
(suffix, ".font"))
+ else if (strEqual
N(suffix, ".font", 5)) /* (may also be ".font_xyz") */
{
result = gfx.get_font_from_token_function(value);
}
{
result = gfx.get_font_from_token_function(value);
}