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 / string / strstr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  294 b   |  19 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. char *strstr(const char *s1,const char *s2)
  5. { const char *c1;
  6.   const char *c2;
  7.   do
  8.   { c1=s1;
  9.     c2=s2;
  10.     while(*c1!='\0'&&*c1==*c2)
  11.     { c1++;
  12.       c2++; }
  13.     if(*c2=='\0')
  14.       return (char *)s1;
  15.   }while(*s1++!='\0');
  16.   return NULL;
  17. }
  18.       
  19.