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,18 @@ _cups_isupper(int ch) /* I - Character { return (ch >= 'A' && ch <= 'Z'); } + +_CUPS_INLINE int /* O - Converted character */ +_cups_tolower(int ch) /* I - Character to convert */ +{ + return (_cups_isupper(ch) ? ch - 'A' + 'a' : ch); +} # 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); # endif /* _CUPS_INLINE */ @@ -146,8 +153,8 @@ extern char *_cups_strdup(const char *); # define strdup _cups_strdup # endif /* !HAVE_STRDUP */ -# ifndef HAVE_STRCASECMP extern int _cups_strcasecmp(const char *, const char *); +# ifndef HAVE_STRCASECMP # define strcasecmp _cups_strcasecmp # endif /* !HAVE_STRCASECMP */ 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)); } Index: cups-1.4.6/cups/string.c =================================================================== --- cups-1.4.6.orig/cups/string.c +++ cups-1.4.6/cups/string.c @@ -637,16 +637,15 @@ _cups_strdup(const char *s) /* I - Stri * '_cups_strcasecmp()' - Do a case-insensitive comparison. */ -#ifndef HAVE_STRCASECMP int /* O - Result of comparison (-1, 0, or 1) */ _cups_strcasecmp(const char *s, /* I - First string */ const char *t) /* I - Second string */ { while (*s != '\0' && *t != '\0') { - if (tolower(*s & 255) < tolower(*t & 255)) + if (_cups_tolower(*s & 255) < _cups_tolower(*t & 255)) return (-1); - else if (tolower(*s & 255) > tolower(*t & 255)) + else if (_cups_tolower(*s & 255) > _cups_tolower(*t & 255)) return (1); s ++; @@ -660,7 +659,6 @@ _cups_strcasecmp(const char *s, /* I - F else return (-1); } -#endif /* !HAVE_STRCASECMP */ /* * '_cups_strncasecmp()' - Do a case-insensitive comparison on up to N chars.