1
/* $XFree86: xc/programs/xedit/strcasecmp.c,v 1.1 1999/06/14 02:38:07 dawes Exp $ */
10
/* Just like the BSD version. It assumes that tolower() is ANSI-compliant */
13
strcasecmp(const char *s1, const char *s2)
15
const unsigned char *us1 = (const unsigned char *)s1;
16
const unsigned char *us2 = (const unsigned char *)s2;
18
while (tolower(*us1) == tolower(*us2++))
21
return tolower(*us1) - tolower(*--us2);
25
strncasecmp(const char *s1, const char *s2, size_t n)
28
const unsigned char *us1 = (const unsigned char *)s1;
29
const unsigned char *us2 = (const unsigned char *)s2;
32
if (tolower(*us1) != tolower(*us2++))
33
return tolower(*us1) - tolower(*--us2);