Piotr Caban : msvcrt: Use correct locale when comparing strings in getenv.

Alexandre Julliard julliard at winehq.org
Mon Mar 18 16:20:13 CDT 2019


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Sun Mar 17 20:19:50 2019 +0100

msvcrt: Use correct locale when comparing strings in getenv.

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/msvcrt.h  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/msvcrt/environ.c b/dlls/msvcrt/environ.c
index f48eabf..cce62bc 100644
--- a/dlls/msvcrt/environ.c
+++ b/dlls/msvcrt/environ.c
@@ -38,7 +38,7 @@ char * CDECL MSVCRT_getenv(const char *name)
     {
         char *str = *environ;
         char *pos = strchr(str,'=');
-        if (pos && ((pos - str) == length) && !strncasecmp(str,name,length))
+        if (pos && ((pos - str) == length) && !MSVCRT__strnicmp(str,name,length))
         {
             TRACE("(%s): got %s\n", debugstr_a(name), debugstr_a(pos + 1));
             return pos + 1;
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index aad8c95..8df8e3b 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -1145,6 +1145,7 @@ void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_
                                        const MSVCRT_wchar_t *file, unsigned int line, MSVCRT_uintptr_t arg);
 int __cdecl      MSVCRT__toupper_l(int,MSVCRT__locale_t);
 int __cdecl      MSVCRT__tolower_l(int,MSVCRT__locale_t);
+int __cdecl      MSVCRT__strnicmp(const char*, const char*, MSVCRT_size_t);
 int __cdecl      MSVCRT__strnicoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
 int __cdecl      MSVCRT__strncoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
 unsigned int __cdecl MSVCRT__get_output_format(void);




More information about the wine-cvs mailing list