summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@lanedo.com>2011-04-15 01:16:54 +0200
committerJan Holesovsky <kendy@suse.cz>2011-04-15 01:20:10 +0200
commite75d09e4e89d3eda7ddaa2c085678edf9a21293f (patch)
treead5194dd8613350564a91488f4f7b9c06fa89638
parenta321df520200bbe8fc1c6c1e3974f53baa652c73 (diff)
Fixed LANG setting in the _imp_setProcessLocale() function.
-rw-r--r--sal/osl/unx/nlsupport.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/sal/osl/unx/nlsupport.c b/sal/osl/unx/nlsupport.c
index 426457195..07d2869a0 100644
--- a/sal/osl/unx/nlsupport.c
+++ b/sal/osl/unx/nlsupport.c
@@ -942,6 +942,16 @@ void _imp_getProcessLocale( rtl_Locale ** ppLocale )
set the current process locale
*****************************************************************************/
+static int
+_setenv (const char* name, const char* value)
+{
+#if defined( AIX )
+ return setenv (name, value, 1);
+#else
+ return setenv (name, value);
+#endif
+}
+
int _imp_setProcessLocale( rtl_Locale * pLocale )
{
char locale_buf[64];
@@ -950,32 +960,14 @@ int _imp_setProcessLocale( rtl_Locale * pLocale )
if( NULL != _compose_locale( pLocale, locale_buf, 64 ) )
{
/* only change env vars that exist already */
- if( getenv( "LC_ALL" ) ) {
-#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || \
- defined( AIX ) || defined( OPENBSD ) || defined( DRAGONFLY )
- setenv( "LC_ALL", locale_buf, 1);
-#else
- setenv( "LC_ALL", locale_buf );
-#endif
- }
+ if( getenv( "LC_ALL" ) )
+ _setenv( "LC_ALL", locale_buf );
- if( getenv( "LC_CTYPE" ) ) {
-#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || \
- defined( AIX ) || defined( OPENBSD ) || defined( DRAGONFLY )
- setenv("LC_CTYPE", locale_buf, 1 );
-#else
- setenv( "LC_CTYPE", locale_buf );
-#endif
- }
+ if( getenv( "LC_CTYPE" ) )
+ _setenv("LC_CTYPE", locale_buf );
- if( getenv( "LANG" ) ) {
-#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || \
- defined( AIX ) || defined( OPENBSD) || defined( DRAGONFLY )
- setenv("LC_CTYPE", locale_buf, 1 );
-#else
- setenv( "LANG", locale_buf );
-#endif
- }
+ if( getenv( "LANG" ) )
+ _setenv( "LANG", locale_buf );
}
return 0;