Module: wine Branch: stable Commit: ff1ce89f624c2082a4bb8975efb7ba49bddf740a URL: https://source.winehq.org/git/wine.git/?a=commit;h=ff1ce89f624c2082a4bb8975e...
Author: Piotr Caban piotr@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@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit b633777ed4d02821029a3b83fdb89fb6fbb66933) Signed-off-by: Michael Stefaniuc mstefani@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 8654218..2fb26b9 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -1143,6 +1143,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);