Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
18
cde/programs/dthelp/parser/pass2/util/strstr.c
Normal file
18
cde/programs/dthelp/parser/pass2/util/strstr.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* $XConsortium: strstr.c /main/3 1995/11/08 11:07:59 rswiston $ */
|
||||
char *strstr ( s1, s2 )
|
||||
char *s1, *s2 ; {
|
||||
|
||||
int x, y ;
|
||||
|
||||
y = strlen ( s2 ) ;
|
||||
x = strlen ( s1 ) - y ;
|
||||
|
||||
if ( x < 0 ) return ( ( char * ) 0L ) ;
|
||||
do {
|
||||
if ( strncmp ( s1 + x, s2, y ) == 0 ) return ( s1 + x ) ;
|
||||
}
|
||||
while ( --x >= 0 ) ;
|
||||
|
||||
return ( ( char * ) 0L ) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user