From c53166f630a168e5a05fa05354ddfda42cd9ca50 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Thu, 10 Feb 2022 08:26:34 +0100 Subject: [PATCH] Set LC_ALL to control the locale LANG specifies the default locale, LC_NUMERIC specifies the locale for that particular category, but LC_ALL overrides all the locale settings. Thus any user with LC_ALL set can still run into locale-related problems. Setting LC_ALL to C avoids any such issue. See locale(7) for details. Signed-off-by: Stephen Kitt --- src/applib/async_command_executor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/applib/async_command_executor.cpp b/src/applib/async_command_executor.cpp index 90c3506..ac197b7 100644 --- a/src/applib/async_command_executor.cpp +++ b/src/applib/async_command_executor.cpp @@ -159,8 +159,7 @@ bool AsyncCommandExecutor::execute() std::unique_ptr child_env(g_get_environ(), &g_strfreev); if (change_lang) { - child_env.reset(g_environ_setenv(child_env.release(), "LANG", "C", TRUE)); - child_env.reset(g_environ_setenv(child_env.release(), "LC_NUMERIC", "C", TRUE)); + child_env.reset(g_environ_setenv(child_env.release(), "LC_ALL", "C", TRUE)); } std::vector envp = Glib::ArrayHandler::array_to_vector(child_env.release(), Glib::OWNERSHIP_DEEP);