From 61684891a0c7d7fb9d6b8e0f0b4f84a2b35087ed Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 9 Feb 2015 14:21:06 +0100 Subject: [PATCH] Set LC_NUMERIC=C for all processes on *NIX fixes #6857 --- lib/base/process.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/base/process.cpp b/lib/base/process.cpp index bf7404161..44f751f46 100644 --- a/lib/base/process.cpp +++ b/lib/base/process.cpp @@ -489,7 +489,7 @@ void Process::Run(const boost::function& callback) while (environ[envc] != NULL) envc++; - char **envp = new char *[envc + (m_ExtraEnvironment ? m_ExtraEnvironment->GetLength() : 0) + 1]; + char **envp = new char *[envc + (m_ExtraEnvironment ? m_ExtraEnvironment->GetLength() : 0) + 2]; for (int i = 0; i < envc; i++) envp[i] = strdup(environ[i]); @@ -505,7 +505,8 @@ void Process::Run(const boost::function& callback) } } - envp[envc + (m_ExtraEnvironment ? m_ExtraEnvironment->GetLength() : 0)] = NULL; + envp[envc + (m_ExtraEnvironment ? m_ExtraEnvironment->GetLength() : 0)] = strdup("LC_NUMERIC=C"); + envp[envc + (m_ExtraEnvironment ? m_ExtraEnvironment->GetLength() : 0) + 1] = NULL; m_ExtraEnvironment.reset();