Module: wine Branch: master Commit: 4a4f138fe9542e1bee240f3b98a3ab91afa842e2 URL: https://gitlab.winehq.org/wine/wine/-/commit/4a4f138fe9542e1bee240f3b98a3ab9...
Author: Piotr Caban piotr@codeweavers.com Date: Fri Jul 21 17:44:02 2023 +0200
msvcrt: Set sname_match in locale_to_sname when returning cached result.
---
dlls/msvcrt/locale.c | 6 ++++-- dlls/msvcrt/msvcrt.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 854ec6e7158..153c4fb1c7d 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -341,8 +341,9 @@ BOOL locale_to_sname(const char *locale, unsigned short *codepage, BOOL *sname_m if (!strcmp(locale, data->cached_locale)) { if (codepage) *codepage = data->cached_cp; - if (sname) - wcsncpy(sname, data->cached_sname, sname_size); + if (sname_match) + *sname_match = data->cached_sname_match; + wcsncpy(sname, data->cached_sname, sname_size); return TRUE; }
@@ -441,6 +442,7 @@ BOOL locale_to_sname(const char *locale, unsigned short *codepage, BOOL *sname_m if (strlen(locale) < sizeof(data->cached_locale)) { strcpy(data->cached_locale, locale); data->cached_cp = locale_cp; + data->cached_sname_match = is_sname; wcscpy(data->cached_sname, sname); }
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 42c41c2200c..155db86bf02 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -170,6 +170,7 @@ struct __thread_data { int processing_throw; frame_info *frame_info_head; void *unk8[6]; + BOOL cached_sname_match; WCHAR cached_sname[LOCALE_NAME_MAX_LENGTH]; int unk9[2]; DWORD cached_cp;