/* XXX: handle locale/MBCS comparison, advance by MBCS char width */
if ((**string >= *startch) && (**string <= **pattern))
result = 0;
- else if (nocase && (isupper(**string) || isupper(*startch)
- || isupper(**pattern))
- && (tolower(**string) >= tolower(*startch))
- && (tolower(**string) <= tolower(**pattern)))
+ else if (nocase && (isupper((unsigned char)**string) ||
+ isupper((unsigned char)*startch) ||
+ isupper((unsigned char)**pattern))
+ && (tolower((unsigned char)**string) >= tolower((unsigned char)*startch))
+ && (tolower((unsigned char)**string) <= tolower((unsigned char)**pattern)))
result = 0;
++*pattern;
/* XXX: handle locale/MBCS comparison, advance by MBCS char width */
if ((**string == **pattern))
result = 0;
- else if (nocase && (isupper(**string) || isupper(**pattern))
- && (tolower(**string) == tolower(**pattern)))
+ else if (nocase && (isupper((unsigned char)**string) ||
+ isupper((unsigned char)**pattern))
+ && (tolower((unsigned char)**string) == tolower((unsigned char)**pattern)))
result = 0;
++*pattern;
/* XXX: handle locale/MBCS comparison, advance by the MBCS char width */
if (**string == **pattern)
result = 0;
- else if (nocase && (isupper(**string) || isupper(**pattern))
- && (tolower(**string) == tolower(**pattern)))
+ else if (nocase && (isupper((unsigned char)**string) || isupper((unsigned char)**pattern))
+ && (tolower((unsigned char)**string) == tolower((unsigned char)**pattern)))
result = 0;
/* Refuse to advance over trailing slash or nulls