From 1c0c0adaea3983504fbe23fd4bf06fdee10af150 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Sep 2014 00:37:17 +0000 Subject: [PATCH] Fix restoring locale in wxCmdLineParser::SetArguments(). We need to call setlocale(NULL) to query the current locale, setlocale("") returns the newly set locale and not the original one. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/cmdline.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 540abefe46..ce9655685b 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -429,7 +429,8 @@ void wxCmdLineParserData::SetArguments(int argc, char **argv) // temporarily change the locale here. The only drawback is that changing // the locale is thread-unsafe but precisely because we're called so early // it's hopefully safe to assume that no other threads had been created yet. - char * const locOld = SetAllLocaleFacets(""); + char * const locOld = SetAllLocaleFacets(NULL); + SetAllLocaleFacets(""); wxON_BLOCK_EXIT1( SetAllLocaleFacets, locOld ); for ( int n = 0; n < argc; n++ )