Fix locale setting for Windows
This commit is contained in:
@@ -563,18 +563,21 @@ int SGTerraSync::SvnThread::svnClientSetup(void)
|
|||||||
if (_svn_pool) return EXIT_SUCCESS;
|
if (_svn_pool) return EXIT_SUCCESS;
|
||||||
// No, so initialize svn internals generally
|
// 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
|
#ifdef _MSC_VER
|
||||||
// there is a segfault when providing an error stream.
|
// there is a segfault when providing an error stream.
|
||||||
// Apparently, calling setvbuf with a nul buffer is
|
// Apparently, calling setvbuf with a nul buffer is
|
||||||
// not supported under msvc 7.1 ( code inside svn_cmdline_init )
|
// not supported under msvc 7.1 ( code inside svn_cmdline_init )
|
||||||
if (svn_cmdline_init("terrasync", 0) != EXIT_SUCCESS)
|
if (svn_cmdline_init("terrasync", 0) != EXIT_SUCCESS)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
|
// revert locale setting
|
||||||
|
setlocale(LC_ALL,"C");
|
||||||
#else
|
#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)
|
if (svn_cmdline_init("terrasync", stderr) != EXIT_SUCCESS)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user