diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-01-31 21:06:52 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-01-31 21:06:52 -0800 |
commit | bb19fe703a2711ddad1b381498fea2d703b92d91 (patch) | |
tree | c2c3d5ada2474073925547ab672f87c744d0c691 /env.cpp | |
parent | eef1e3e77e9ec1c80c7a388c2a5433bbc9910db3 (diff) |
Fixup wsetlocale to use wcstring
Diffstat (limited to 'env.cpp')
-rw-r--r-- | env.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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 ); - + } } |