msvcrt: Don't use strstrW in wcsstr.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
071a71a866
commit
ae9c385e13
|
@ -2652,7 +2652,19 @@ int CDECL MSVCRT_wcslen(const MSVCRT_wchar_t *str)
|
||||||
*/
|
*/
|
||||||
MSVCRT_wchar_t* CDECL MSVCRT_wcsstr(const MSVCRT_wchar_t *str, const MSVCRT_wchar_t *sub)
|
MSVCRT_wchar_t* CDECL MSVCRT_wcsstr(const MSVCRT_wchar_t *str, const MSVCRT_wchar_t *sub)
|
||||||
{
|
{
|
||||||
return strstrW(str, sub);
|
while(*str)
|
||||||
|
{
|
||||||
|
const MSVCRT_wchar_t *p1 = str, *p2 = sub;
|
||||||
|
while(*p1 && *p2 && *p1 == *p2)
|
||||||
|
{
|
||||||
|
p1++;
|
||||||
|
p2++;
|
||||||
|
}
|
||||||
|
if(!*p2)
|
||||||
|
return (MSVCRT_wchar_t*)str;
|
||||||
|
str++;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
|
Loading…
Reference in New Issue