Piotr Caban : msvcrt: Use _strnicmp instead of strncasecmp.

Alexandre Julliard julliard at winehq.org
Tue Mar 26 16:43:14 CDT 2019


Module: wine
Branch: master
Commit: f48ea297268e832c93a22fb5b92f73620c717280
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f48ea297268e832c93a22fb5b92f73620c717280

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Mar 26 11:31:13 2019 +0100

msvcrt: Use _strnicmp instead of strncasecmp.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 1e05711..fc41f05 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 bc528f1..95b4f2b 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 17eee1c..f9185cc 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);




More information about the wine-cvs mailing list