]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/tsync/terrasync.cxx
Remove using std:: from the metar header, remove HTTP support, add very basic unit...
[simgear.git] / simgear / scene / tsync / terrasync.cxx
index 197d63c04d35ceecc7f6641990ffff38a6b7cbf9..0f99d4e508c739aaeafa5f64362539a21c7d274e 100644 (file)
@@ -86,6 +86,7 @@
 #endif
 
 using namespace simgear;
+using namespace std;
 
 const char* rsync_cmd = 
         "rsync --verbose --archive --delete --perms --owner --group";
@@ -569,16 +570,18 @@ int SGTerraSync::SvnThread::svnClientSetup(void)
     //  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
-    /* Oh no! svn_cmdline_init configures the locale - affecting numeric output
-     * formats (i.e. sprintf("%f", ...)). fgfs relies on "C" locale in many places
-     * (including assumptions on required sprintf buffer sizes). Things go horribly
-     * wrong when the locale is changed to anything else but "C". Might be enough to
-     * revert LC_NUMERIC locale - but we'll do a complete revert for now...*/
-    setlocale(LC_ALL,"C");
 
     apr_pool_t *pool;
     apr_pool_create(&pool, NULL);