diff options
author | Akira TAGOH <akira@tagoh.org> | 2018-03-14 12:35:05 +0900 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2018-03-14 12:35:05 +0900 |
commit | 923b5be626a6e03fbaeee0b5cd6d0246c2f8f36f (patch) | |
tree | 0255488b7a1ed45b104f2196766fc3b8dd629de7 /src | |
parent | 198358dd8ff858c9e36531a7406ccb2246ae77b7 (diff) |
Do not override locale if already set by app
https://bugs.freedesktop.org/show_bug.cgi?id=105492
Diffstat (limited to 'src')
-rw-r--r-- | src/fccfg.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/fccfg.c b/src/fccfg.c index eb0b76dc..e311f177 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -45,11 +45,16 @@ retry_locale: is_locale_initialized = (intptr_t) fc_atomic_ptr_get (&static_is_locale_initialized); if (!is_locale_initialized) { + char *loc; + is_locale_initialized = FcTrue; if (!fc_atomic_ptr_cmpexch (&static_is_locale_initialized, NULL, (void *)(intptr_t) is_locale_initialized)) goto retry_locale; - setlocale (LC_ALL, ""); + + loc = setlocale (LC_ALL, NULL); + if (!loc || strcmp (loc, "C") == 0) + setlocale (LC_ALL, ""); } retry_config: config = fc_atomic_ptr_get (&_fcConfig); |