update for HEAD-2003091401
[reactos.git] / lib / msvcrt / string / strstr.c
1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2 #include <msvcrt/string.h>
3
4
5 /*
6  * @implemented
7  */
8 char *strstr(const char *s, const char *find)
9 {
10   char c, sc;
11   size_t len;
12
13   if ((c = *find++) != 0)
14   {
15     len = strlen(find);
16     do {
17       do {
18         if ((sc = *s++) == 0)
19           return 0;
20       } while (sc != c);
21     } while (strncmp(s, find, len) != 0);
22     s--;
23   }
24   return (char *)s;
25 }