Commit 1ca971a2 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Don't use strcmpiW in _wcsicmp_l.

parent 8fd5ef68
...@@ -86,12 +86,48 @@ MSVCRT_wchar_t* CDECL MSVCRT__wcsdup( const MSVCRT_wchar_t* str ) ...@@ -86,12 +86,48 @@ MSVCRT_wchar_t* CDECL MSVCRT__wcsdup( const MSVCRT_wchar_t* str )
return ret; return ret;
} }
/*********************************************************************
* _towlower_l (MSVCRT.@)
*/
int CDECL MSVCRT__towlower_l(MSVCRT_wint_t c, MSVCRT__locale_t locale)
{
MSVCRT_pthreadlocinfo locinfo;
if(!locale)
locinfo = get_locinfo();
else
locinfo = locale->locinfo;
if(!locinfo->lc_handle[MSVCRT_LC_CTYPE]) {
if(c >= 'A' && c <= 'Z')
return c + 'a' - 'A';
return c;
}
return tolowerW(c);
}
/*********************************************************************
* towlower (MSVCRT.@)
*/
int CDECL MSVCRT_towlower(MSVCRT_wint_t c)
{
return MSVCRT__towlower_l(c, NULL);
}
INT CDECL MSVCRT__wcsicmp_l(const MSVCRT_wchar_t *str1, const MSVCRT_wchar_t *str2, MSVCRT__locale_t locale) INT CDECL MSVCRT__wcsicmp_l(const MSVCRT_wchar_t *str1, const MSVCRT_wchar_t *str2, MSVCRT__locale_t locale)
{ {
MSVCRT_wchar_t c1, c2;
if(!MSVCRT_CHECK_PMT(str1 != NULL) || !MSVCRT_CHECK_PMT(str2 != NULL)) if(!MSVCRT_CHECK_PMT(str1 != NULL) || !MSVCRT_CHECK_PMT(str2 != NULL))
return MSVCRT__NLSCMPERROR; return MSVCRT__NLSCMPERROR;
return strcmpiW(str1, str2); do
{
c1 = MSVCRT__towlower_l(*str1++, locale);
c2 = MSVCRT__towlower_l(*str2++, locale);
} while(c1 && (c1 == c2));
return c1 - c2;
} }
/********************************************************************* /*********************************************************************
...@@ -99,7 +135,7 @@ INT CDECL MSVCRT__wcsicmp_l(const MSVCRT_wchar_t *str1, const MSVCRT_wchar_t *st ...@@ -99,7 +135,7 @@ INT CDECL MSVCRT__wcsicmp_l(const MSVCRT_wchar_t *str1, const MSVCRT_wchar_t *st
*/ */
INT CDECL MSVCRT__wcsicmp( const MSVCRT_wchar_t* str1, const MSVCRT_wchar_t* str2 ) INT CDECL MSVCRT__wcsicmp( const MSVCRT_wchar_t* str1, const MSVCRT_wchar_t* str2 )
{ {
return strcmpiW( str1, str2 ); return MSVCRT__wcsicmp_l(str1, str2, NULL);
} }
/********************************************************************* /*********************************************************************
...@@ -2541,35 +2577,6 @@ int CDECL MSVCRT_towupper(MSVCRT_wint_t c) ...@@ -2541,35 +2577,6 @@ int CDECL MSVCRT_towupper(MSVCRT_wint_t c)
} }
/********************************************************************* /*********************************************************************
* _towlower_l (MSVCRT.@)
*/
int CDECL MSVCRT__towlower_l(MSVCRT_wint_t c, MSVCRT__locale_t locale)
{
MSVCRT_pthreadlocinfo locinfo;
if(!locale)
locinfo = get_locinfo();
else
locinfo = locale->locinfo;
if(!locinfo->lc_handle[MSVCRT_LC_CTYPE]) {
if(c >= 'A' && c <= 'Z')
return c + 'a' - 'A';
return c;
}
return tolowerW(c);
}
/*********************************************************************
* towlower (MSVCRT.@)
*/
int CDECL MSVCRT_towlower(MSVCRT_wint_t c)
{
return MSVCRT__towlower_l(c, NULL);
}
/*********************************************************************
* wcschr (MSVCRT.@) * wcschr (MSVCRT.@)
*/ */
MSVCRT_wchar_t* CDECL MSVCRT_wcschr(const MSVCRT_wchar_t *str, MSVCRT_wchar_t ch) MSVCRT_wchar_t* CDECL MSVCRT_wcschr(const MSVCRT_wchar_t *str, MSVCRT_wchar_t ch)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment