2007-03-14 20:24:57 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
2015-09-19 13:50:57 +00:00
|
|
|
* FILE: lib/sdk/crt/string/strstr.c
|
2007-03-14 20:24:57 +00:00
|
|
|
* PURPOSE: Unknown
|
|
|
|
* PROGRAMER: Unknown
|
|
|
|
* UPDATE HISTORY:
|
|
|
|
* 25/11/05: Added license header
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <precomp.h>
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2007-11-08 21:06:20 +00:00
|
|
|
char *
|
2015-09-15 10:35:49 +00:00
|
|
|
CDECL
|
2007-11-08 21:06:20 +00:00
|
|
|
strstr(const char *s, const char *find)
|
2007-03-14 20:24:57 +00:00
|
|
|
{
|
|
|
|
char c, sc;
|
|
|
|
size_t len;
|
|
|
|
|
|
|
|
if ((c = *find++) != 0)
|
|
|
|
{
|
|
|
|
len = strlen(find);
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
if ((sc = *s++) == 0)
|
|
|
|
return 0;
|
|
|
|
} while (sc != c);
|
|
|
|
} while (strncmp(s, find, len) != 0);
|
|
|
|
s--;
|
|
|
|
}
|
2007-11-08 21:06:20 +00:00
|
|
|
return (char *)((size_t)s);
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|