[Fontconfig] fontconfig: Branch 'master'

Akira TAGOH tagoh at kemper.freedesktop.org
Wed Mar 14 03:40:56 UTC 2018


 src/fccfg.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 923b5be626a6e03fbaeee0b5cd6d0246c2f8f36f
Author: Akira TAGOH <akira at tagoh.org>
Date:   Wed Mar 14 12:35:05 2018 +0900

    Do not override locale if already set by app
    
    https://bugs.freedesktop.org/show_bug.cgi?id=105492

diff --git a/src/fccfg.c b/src/fccfg.c
index eb0b76d..e311f17 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);


More information about the Fontconfig mailing list