URI:
       tcistrcmp.c - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tcistrcmp.c (323B)
       ---
            1 #include <u.h>
            2 #include <libc.h>
            3 
            4 int
            5 cistrcmp(char *s1, char *s2)
            6 {
            7         int c1, c2;
            8 
            9         while(*s1){
           10                 c1 = *(uchar*)s1++;
           11                 c2 = *(uchar*)s2++;
           12 
           13                 if(c1 == c2)
           14                         continue;
           15 
           16                 if(c1 >= 'A' && c1 <= 'Z')
           17                         c1 -= 'A' - 'a';
           18 
           19                 if(c2 >= 'A' && c2 <= 'Z')
           20                         c2 -= 'A' - 'a';
           21 
           22                 if(c1 != c2)
           23                         return c1 - c2;
           24         }
           25         return -*s2;
           26 }