home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / alde_c / misc / lib / dlibssrc / stristr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-14  |  369 b   |  20 lines

  1. #include <d:\usr\stdlib\stdio.h>
  2.  
  3. char *stristr(string, pattern)
  4. register char *string;
  5. register char *pattern;
  6. /*
  7.  *    Same as strstr(), but ignore the case of any alphabetic characters.
  8.  */
  9. {
  10.     register int plen;
  11.  
  12.     plen = strlen(pattern);
  13.     while(*string) {
  14.         if(strnicmp(string, pattern, plen) == 0)
  15.             return(string);
  16.         ++string;
  17.     }
  18.     return(NULL);
  19. }
  20.