2001-03-06 11:17:54 +03:00
|
|
|
/* public domain rewrite of strcasecmp(3) */
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
#include <ctype.h>
|
|
|
|
|
|
|
|
int
|
2005-10-22 05:28:00 +04:00
|
|
|
strcasecmp(const char *p1, const char *p2)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2001-03-06 11:17:54 +03:00
|
|
|
while (*p1 && *p2) {
|
1998-01-16 15:13:05 +03:00
|
|
|
if (toupper(*p1) != toupper(*p2))
|
|
|
|
return toupper(*p1) - toupper(*p2);
|
2001-03-06 11:17:54 +03:00
|
|
|
p1++;
|
|
|
|
p2++;
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
return strlen(p1) - strlen(p2);
|
|
|
|
}
|