1 /* Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
2 * This file is part of the Linux-8086 C library and is distributed
3 * under the GNU Library General Public License.
9 /* We've now got a nice fast strchr and memcmp use them */
15 register int l
= strlen(s2
);
16 register char * p
= s1
;
20 while (p
= strchr(p
, *s2
))
22 if( memcmp(p
, s2
, l
) == 0 )
30 /* This is a nice simple self contained strstr,
31 now go and work out why the GNU one is faster :-) */
33 char *strstr(str1
, str2
)
36 register char *Sptr
, *Tptr
;
37 int len
= strlen(str1
) -strlen(str2
) + 1;
40 for (; len
> 0; len
--, str1
++){
44 for (Sptr
= str1
, Tptr
= str2
; *Tptr
!= '\0'; Sptr
++, Tptr
++)