strcasecmp.c - randomcrap - random crap programs of varying quality
 (HTM) git clone git://git.codemadness.org/randomcrap
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       strcasecmp.c (258B)
       ---
            1 #include <ctype.h>
            2 
            3 int
            4 strcasecmp(const char *s1, const char *s2)
            5 {
            6         for (; *s1 && *s2 && (*s1 == *s2 ||
            7              tolower((unsigned char)*s1) == tolower((unsigned char)*s2)); s1++, s2++)
            8                 ;
            9         return tolower((unsigned char)*s1) - tolower((unsigned char)*s2);
           10 }