xref: /reactos/sdk/lib/crt/wstring/wcsstr.c (revision 50cf16b3)
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/sdk/crt/wstring/wcsstr.c
5  * PURPOSE:     Unknown
6  * PROGRAMER:   Unknown
7  * UPDATE HISTORY:
8  *              25/11/05: Added license header
9  */
10 
11 #include <precomp.h>
12 
13 /*
14  * @implemented
15  */
16 wchar_t * CDECL wcsstr(const wchar_t *s,const wchar_t *b)
17 {
18 	wchar_t *x;
19 	wchar_t *y;
20 	wchar_t *c;
21 	x=(wchar_t *)s;
22 	while (*x) {
23 		if (*x==*b) {
24 			y=x;
25 			c=(wchar_t *)b;
26 			while (*y && *c && *y==*c) {
27 				c++;
28 				y++;
29 			}
30 			if (!*c)
31 				return x;
32 		}
33 		x++;
34 	}
35 	return NULL;
36 }
37