From 116c487384f16a560da5cdfe096381e776fd4319 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Mon, 18 Jul 2011 20:29:11 +0200 Subject: [PATCH] Fix locale setting for Windows --- simgear/scene/tsync/terrasync.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/simgear/scene/tsync/terrasync.cxx b/simgear/scene/tsync/terrasync.cxx index 0c28a46c..357390cc 100644 --- a/simgear/scene/tsync/terrasync.cxx +++ b/simgear/scene/tsync/terrasync.cxx @@ -563,18 +563,21 @@ int SGTerraSync::SvnThread::svnClientSetup(void) if (_svn_pool) return EXIT_SUCCESS; // No, so initialize svn internals generally - /* svn_cmdline_init configures the locale. Setup environment to ensure the - * default "C" locale remains active, since fgfs isn't locale aware - especially - * requires "." as decimal point in strings containing floating point varibales. */ - setenv("LC_ALL", "C", 1); - #ifdef _MSC_VER // there is a segfault when providing an error stream. // Apparently, calling setvbuf with a nul buffer is // not supported under msvc 7.1 ( code inside svn_cmdline_init ) if (svn_cmdline_init("terrasync", 0) != EXIT_SUCCESS) return EXIT_FAILURE; + + // revert locale setting + setlocale(LC_ALL,"C"); #else + /* svn_cmdline_init configures the locale. Setup environment to ensure the + * default "C" locale remains active, since fgfs isn't locale aware - especially + * requires "." as decimal point in strings containing floating point varibales. */ + setenv("LC_ALL", "C", 1); + if (svn_cmdline_init("terrasync", stderr) != EXIT_SUCCESS) return EXIT_FAILURE; #endif -- 2.39.5