home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / unixtools / util / c / strlcmp < prev    next >
Encoding:
Text File  |  1992-07-21  |  326 b   |  15 lines

  1. /*      > C.Strlcmp     - compare two strings, ignoring case      */
  2.  
  3. #include <ctype.h>
  4. #include "utils.h"
  5.  
  6. int strlcmp (const char *s, const char *t)
  7. {
  8.  
  9.         for ( ; tolower(*s) == tolower(*t); ++s, ++t )
  10.                 if ( *s == '\0' )
  11.                         return(0);
  12.  
  13.         return (tolower(*s) - tolower(*t));
  14. }
  15.