version 1.10, 1998/12/20 23:38:11 |
version 1.11, 1999/11/11 11:35:17 |
|
|
return rv; |
return rv; |
} |
} |
#endif |
#endif |
|
|
|
#ifdef NEED_STRSTR |
|
char * |
|
strstr(string, substring) |
|
const char *string; /* String to search. */ |
|
const char *substring; /* Substring to find in string */ |
|
{ |
|
const char *a, *b; |
|
|
|
/* |
|
* First scan quickly through the two strings looking for a single- |
|
* character match. When it's found, then compare the rest of the |
|
* substring. |
|
*/ |
|
|
|
for (b = substring; *string != 0; string += 1) { |
|
if (*string != *b) |
|
continue; |
|
a = string; |
|
for (;;) { |
|
if (*b == 0) |
|
return (char *)string; |
|
if (*a++ != *b++) |
|
break; |
|
} |
|
b = substring; |
|
} |
|
return NULL; |
|
} |
|
#endif |