From f48ea297268e832c93a22fb5b92f73620c717280 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 26 Mar 2019 11:31:13 +0100 Subject: [PATCH] msvcrt: Use _strnicmp instead of strncasecmp. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/locale.c | 2 +- dlls/msvcrt/mbcs.c | 2 +- dlls/msvcrt/string.c | 11 +---------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 1e057113deb..fc41f05da23 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -142,7 +142,7 @@ static int compare_info(LCID lcid, DWORD flags, char* buff, const char* cmp, BOO if(exact || len<=3) return !MSVCRT__stricmp(cmp, buff); else - return !strncasecmp(cmp, buff, len); + return !MSVCRT__strnicmp(cmp, buff, len); } static BOOL CALLBACK diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index bc528f1b230..95b4f2bc2c4 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -133,7 +133,7 @@ static inline int u_strncmp( const unsigned char *s1, const unsigned char *s2, M static inline int u_strncasecmp( const unsigned char *s1, const unsigned char *s2, MSVCRT_size_t len ) { - return strncasecmp( (const char*)s1, (const char*)s2, len ); + return MSVCRT__strnicmp( (const char*)s1, (const char*)s2, len ); } static inline unsigned char *u_strchr( const unsigned char *s, unsigned char x ) diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 17eee1c2cc9..f9185cc0e41 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -694,7 +694,7 @@ int CDECL MSVCRT__strnicoll_l( const char* str1, const char* str2, MSVCRT_size_t locinfo = locale->locinfo; if(!locinfo->lc_handle[MSVCRT_LC_COLLATE]) - return strncasecmp(str1, str2, count); + return MSVCRT__strnicmp(str1, str2, count); return CompareStringA(locinfo->lc_handle[MSVCRT_LC_COLLATE], NORM_IGNORECASE, str1, MSVCRT_strnlen(str1, count), str2, MSVCRT_strnlen(str2, count))-CSTR_EQUAL; @@ -1960,7 +1960,6 @@ int __cdecl MSVCRT_strncmp(const char *str1, const char *str2, MSVCRT_size_t len int __cdecl MSVCRT__strnicmp_l(const char *s1, const char *s2, MSVCRT_size_t count, MSVCRT__locale_t locale) { - MSVCRT_pthreadlocinfo locinfo; int c1, c2; if(s1==NULL || s2==NULL) @@ -1969,14 +1968,6 @@ int __cdecl MSVCRT__strnicmp_l(const char *s1, const char *s2, if(!count) return 0; - if(!locale) - locinfo = get_locinfo(); - else - locinfo = locale->locinfo; - - if(!locinfo->lc_handle[MSVCRT_LC_CTYPE]) - return strncasecmp(s1, s2, count); - do { c1 = MSVCRT__tolower_l(*s1++, locale); c2 = MSVCRT__tolower_l(*s2++, locale);