aboutsummaryrefslogtreecommitdiffhomepage
path: root/env.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-01-31 21:06:52 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-01-31 21:06:52 -0800
commitbb19fe703a2711ddad1b381498fea2d703b92d91 (patch)
treec2c3d5ada2474073925547ab672f87c744d0c691 /env.cpp
parenteef1e3e77e9ec1c80c7a388c2a5433bbc9910db3 (diff)
Fixup wsetlocale to use wcstring
Diffstat (limited to 'env.cpp')
-rw-r--r--env.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/env.cpp b/env.cpp
index d6c294a9..10ce3d8a 100644
--- a/env.cpp
+++ b/env.cpp
@@ -296,7 +296,7 @@ static void handle_locale()
{
const env_var_t lc_all = env_get_string( L"LC_ALL" );
int i;
- wchar_t *old = wcsdup(wsetlocale( LC_MESSAGES, NULL ));
+ const wcstring old_locale = wsetlocale( LC_MESSAGES, NULL );
/*
Array of locale constants corresponding to the local variable names defined in locale_variable
@@ -337,7 +337,8 @@ static void handle_locale()
}
}
- if( wcscmp( wsetlocale( LC_MESSAGES, NULL ), old ) != 0 )
+ const wcstring new_locale = wsetlocale(LC_MESSAGES, NULL);
+ if( old_locale != new_locale )
{
/*
@@ -357,9 +358,7 @@ static void handle_locale()
{
debug( 0, _(L"Changing language to English") );
}
- }
- free( old );
-
+ }
}