Import upstream 2.3.14
[packages/xinetd.git] / libs / src / portable / strcasecmp.c
1 typedef unsigned char u_char;
2
3 int
4 strcasecmp(s1, s2)
5                 const char *s1, *s2;
6 {
7         register const u_char
8         *us1 = (const u_char *)s1,
9         *us2 = (const u_char *)s2;
10
11         while (tolower(*us1) == tolower(*us2++))
12                 if (*us1++ == '\0')
13                         return (0);
14         return (tolower(*us1) - tolower(*--us2));
15 }