Index: cups-1.4.6/cups/string.h =================================================================== --- cups-1.4.6.orig/cups/string.h +++ cups-1.4.6/cups/string.h @@ -127,11 +127,40 @@ _cups_isupper(int ch) /* I - Character { return (ch >= 'A' && ch <= 'Z'); } + +_CUPS_INLINE int +_cups_tolower(int ch) +{ + return (_cups_isupper(ch) ? ch - 'A' + 'a' : ch); +} + +_CUPS_INLINE int +_cups_strcasecmp(const char *s1, + const char *s2) +{ + int c1, c2; + + if (s1 == NULL || s2 == NULL) + return 0; + + while (*s1 && *s2) + { + c1 = _cups_tolower(*s1); + c2 = _cups_tolower(*s2); + if (c1 != c2) + return (c1 - c2); + s1++; s2++; + } + + return ((int) *s1) - ((int) *s2); +} # else extern int _cups_isalnum(int ch); extern int _cups_isalpha(int ch); extern int _cups_isspace(int ch); extern int _cups_isupper(int ch); +extern int _cups_tolower(int ch); +extern int _cups_strcasecmp(int ch); # endif /* _CUPS_INLINE */ Index: cups-1.4.6/cgi-bin/var.c =================================================================== --- cups-1.4.6.orig/cgi-bin/var.c +++ cups-1.4.6/cgi-bin/var.c @@ -608,7 +608,7 @@ cgi_compare_variables( const _cgi_var_t *v1, /* I - First variable */ const _cgi_var_t *v2) /* I - Second variable */ { - return (strcasecmp(v1->name, v2->name)); + return (_cups_strcasecmp(v1->name, v2->name)); }