From 3c51bd6a2bcfdd32fd09ce0f9a1fcb771296fd24 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 25 Apr 2023 15:55:42 -0400 Subject: [PATCH] libroot: Fix initialization of LocaleNumericDataBridge. We need to store the isGlobal value, so that the destructor can take care of unsetting the glibc locale properly. It seems this has been broken since d338200e2b7c03c7aa392598b8612d4e9afa1841. Fixes #18344 and probably #18336. --- src/system/libroot/posix/locale/LocaleDataBridge.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/libroot/posix/locale/LocaleDataBridge.cpp b/src/system/libroot/posix/locale/LocaleDataBridge.cpp index 140650fddc..306a5dd54c 100644 --- a/src/system/libroot/posix/locale/LocaleDataBridge.cpp +++ b/src/system/libroot/posix/locale/LocaleDataBridge.cpp @@ -89,7 +89,8 @@ LocaleMonetaryDataBridge::LocaleMonetaryDataBridge() LocaleNumericDataBridge::LocaleNumericDataBridge(bool isGlobal) : posixLocaleConv(&gPosixLocaleConv), - glibcNumericLocale(&glibcNumericLocaleData) + glibcNumericLocale(&glibcNumericLocaleData), + isGlobal(isGlobal) { memcpy(glibcNumericLocale, _NL_GLOBAL_DATA(GLIBC_LC_NUMERIC),