Make strcasecmp() act correctly WRT SUS II.

Patch by: hholzgra@php.net
PR: #3556
This commit is contained in:
Sascha Schumann 2000-05-08 10:05:19 +00:00
parent 9930bab2a6
commit 36c1a9a39d

View file

@ -1299,21 +1299,19 @@ ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint
ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2)
{
unsigned char c1 = 0, c2 = 0;
int len;
if (len1 != len2 || !len1) {
return len1 - len2;
}
len = MIN(len1, len2);
while (len1--) {
while (len--) {
c1 = tolower(*s1++);
c2 = tolower(*s2++);
if (c1 != c2) {
break;
return c1 - c2;
}
}
return c1 - c2;
return len1 - len2;
}