--- a/mcabber/src/utils.c Fri Apr 27 23:46:15 2007 +0200
+++ b/mcabber/src/utils.c Sat Apr 28 12:16:45 2007 +0200
@@ -648,11 +648,13 @@
}
#endif /* !HAVE_STRCASESTR */
-// startswith(str, word)
+// startswith(str, word, ignore_case)
// Returns TRUE if string str starts with word.
-int startswith(const char *str, const char *word)
+int startswith(const char *str, const char *word, guint ignore_case)
{
- if (!strncmp(str, word, strlen(word)))
+ if (ignore_case && !strncasecmp(str, word, strlen(word)))
+ return TRUE;
+ else if (!ignore_case && !strncmp(str, word, strlen(word)))
return TRUE;
return FALSE;
}