home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / libnix-0.8-src.lha / libnix-0.8 / sources / nix / extra / stricmp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  487 b   |  37 lines

  1. #include <ctype.h>
  2. #ifdef __GNUC__
  3. #include <inline/utility.h>
  4. #endif
  5. #include <stabs.h>
  6.  
  7. int stricmp(const char *s1,const char *s2)
  8. {
  9. #ifndef OS_20_ONLY
  10.  
  11.   unsigned char c1,c2;
  12.   int r;
  13.  
  14.   for(;;)
  15.   {
  16.     c1=*s1++;
  17.     if (isupper(c1))
  18.       c1+='a'-'A';
  19.     c2=*s2;
  20.     if (isupper(c2))
  21.       c2+='a'-'A';
  22.     if ((r=(char)c1-(char)c2)!=0)
  23.       break;
  24.     if (!*s2++)
  25.       break;
  26.   }
  27.   return r;
  28.  
  29. #else
  30.  
  31.   return Stricmp((char *)s1,(char *)s2);
  32.  
  33. #endif
  34. }
  35.  
  36. ALIAS(strcasecmp,stricmp);
  37.