From ff1ce89f624c2082a4bb8975efb7ba49bddf740a Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Sun, 17 Mar 2019 20:19:50 +0100 Subject: [PATCH] msvcrt: Use correct locale when comparing strings in getenv. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard (cherry picked from commit b633777ed4d02821029a3b83fdb89fb6fbb66933) Signed-off-by: Michael Stefaniuc --- 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 f48eabf7e83..cce62bc6a58 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 86542184b43..2fb26b94e42 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);