home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source: /unixb/home/unixlib/source/unixlib37/src/c/RCS/strstr,v $
- * $Date: 1996/04/19 21:26:42 $
- * $Revision: 1.1 $
- * $State: Rel $
- * $Author: simon $
- *
- * $Log: strstr,v $
- * Revision 1.1 1996/04/19 21:26:42 simon
- * Initial revision
- *
- ***************************************************************************/
-
- static const char rcs_id[] = "$Id: strstr,v 1.1 1996/04/19 21:26:42 simon Rel $";
-
- #include <string.h>
-
- char *
- strstr (register const char *s1, register const char *s2)
-
- {
- register int l1 = strlen (s1), l2 = strlen (s2);
- register const char *e1 = s1 + l1 - l2;
-
- while (s1 <= e1)
- {
- if (!strncmp (s1, s2, l2))
- return ((char *) s1);
- s1++;
- }
-
- return (0);
- }
-