X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9fbcc67955838d02ded8673148f3134b1c959458..c437b3f4e47b74715a2f2385d4862972babd7802:/src/common/intl.cpp?ds=sidebyside diff --git a/src/common/intl.cpp b/src/common/intl.cpp index ce5a0adfbf..0960dfc57b 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -2517,13 +2517,12 @@ bool wxLocale::IsAvailable(int lang) #elif defined(__UNIX__) // Test if setting the locale works, then set it back. - const char *oldLocale = wxSetlocale(LC_ALL, ""); - const char *tmp = wxSetlocaleTryUTF8(LC_ALL, info->CanonicalName); - if ( !tmp ) + const char *oldLocale = wxSetlocaleTryUTF8(LC_ALL, info->CanonicalName); + if ( !oldLocale ) { // Some C libraries don't like xx_YY form and require xx only - tmp = wxSetlocaleTryUTF8(LC_ALL, ExtractLang(info->CanonicalName)); - if ( !tmp ) + oldLocale = wxSetlocaleTryUTF8(LC_ALL, ExtractLang(info->CanonicalName)); + if ( !oldLocale ) return false; } // restore the original locale