Do not override locale if already set by app

https://bugs.freedesktop.org/show_bug.cgi?id=105492
This commit is contained in:
Akira TAGOH 2018-03-14 12:35:05 +09:00
parent 198358dd8f
commit 923b5be626
1 changed files with 6 additions and 1 deletions

View File

@ -45,11 +45,16 @@ retry_locale:
is_locale_initialized = (intptr_t) fc_atomic_ptr_get (&static_is_locale_initialized); is_locale_initialized = (intptr_t) fc_atomic_ptr_get (&static_is_locale_initialized);
if (!is_locale_initialized) if (!is_locale_initialized)
{ {
char *loc;
is_locale_initialized = FcTrue; is_locale_initialized = FcTrue;
if (!fc_atomic_ptr_cmpexch (&static_is_locale_initialized, NULL, if (!fc_atomic_ptr_cmpexch (&static_is_locale_initialized, NULL,
(void *)(intptr_t) is_locale_initialized)) (void *)(intptr_t) is_locale_initialized))
goto retry_locale; goto retry_locale;
setlocale (LC_ALL, "");
loc = setlocale (LC_ALL, NULL);
if (!loc || strcmp (loc, "C") == 0)
setlocale (LC_ALL, "");
} }
retry_config: retry_config:
config = fc_atomic_ptr_get (&_fcConfig); config = fc_atomic_ptr_get (&_fcConfig);