Piotr Caban : msvcrt: Use _wcsnicmp instead of strnicmpW.

Alexandre Julliard julliard at winehq.org
Tue Jul 14 16:23:39 CDT 2020


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Jul 14 20:23:38 2020 +0200

msvcrt: Use _wcsnicmp instead of strnicmpW.

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

---

 dlls/msvcrt/environ.c | 2 +-
 dlls/msvcrt/file.c    | 6 +++---
 dlls/msvcrt/msvcrt.h  | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/msvcrt/environ.c b/dlls/msvcrt/environ.c
index cc180e819e..ef8038d971 100644
--- a/dlls/msvcrt/environ.c
+++ b/dlls/msvcrt/environ.c
@@ -63,7 +63,7 @@ MSVCRT_wchar_t * CDECL MSVCRT__wgetenv(const MSVCRT_wchar_t *name)
     {
         MSVCRT_wchar_t *str = *environ;
         MSVCRT_wchar_t *pos = strchrW(str,'=');
-        if (pos && ((pos - str) == length) && !strncmpiW(str,name,length))
+        if (pos && ((pos - str) == length) && !MSVCRT__wcsnicmp(str,name,length))
         {
             TRACE("(%s): got %s\n", debugstr_w(name), debugstr_w(pos + 1));
             return pos + 1;
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 868a752575..d5c227190c 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -1620,17 +1620,17 @@ static int msvcrt_get_flags(const MSVCRT_wchar_t* mode, int *open_flags, int* st
     mode++;
     while(*mode == ' ') mode++;
 
-    if(!strncmpiW(utf8, mode, ARRAY_SIZE(utf8)))
+    if(!MSVCRT__wcsnicmp(utf8, mode, ARRAY_SIZE(utf8)))
     {
       *open_flags |= MSVCRT__O_U8TEXT;
       mode += ARRAY_SIZE(utf8);
     }
-    else if(!strncmpiW(utf16le, mode, ARRAY_SIZE(utf16le)))
+    else if(!MSVCRT__wcsnicmp(utf16le, mode, ARRAY_SIZE(utf16le)))
     {
       *open_flags |= MSVCRT__O_U16TEXT;
       mode += ARRAY_SIZE(utf16le);
     }
-    else if(!strncmpiW(unicode, mode, ARRAY_SIZE(unicode)))
+    else if(!MSVCRT__wcsnicmp(unicode, mode, ARRAY_SIZE(unicode)))
     {
       *open_flags |= MSVCRT__O_WTEXT;
       mode += ARRAY_SIZE(unicode);
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index c4263ccc16..ef1154ce76 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -1197,6 +1197,7 @@ char* __cdecl MSVCRT_strtok_s(char*, const char*, char**);
 char* __cdecl MSVCRT__itoa(int, char*, int);
 double parse_double(MSVCRT_wchar_t (*)(void*), void (*)(void*), void*, MSVCRT_pthreadlocinfo, int*);
 int __cdecl MSVCRT_wcsncmp(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_size_t);
+int __cdecl MSVCRT__wcsnicmp(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_size_t);
 
 /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd)
  *      #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0)




More information about the wine-cvs mailing list