void-packages/srcpkgs/fontconfig/patches/01-locale.patch

36 lines
1002 B
Diff
Raw Normal View History

From 923b5be626a6e03fbaeee0b5cd6d0246c2f8f36f Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Wed, 14 Mar 2018 12:35:05 +0900
Subject: Do not override locale if already set by app
https://bugs.freedesktop.org/show_bug.cgi?id=105492
---
src/fccfg.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/fccfg.c b/src/fccfg.c
index eb0b76d..e311f17 100644
--- src/fccfg.c
+++ 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);
--
cgit v1.1