summaryrefslogtreecommitdiff
path: root/pango/pango-language.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-06-26 13:15:38 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-06-27 08:50:07 +0200
commit33b83516e17a6a34265d036f9e02b272cd1b436a (patch)
tree604dfb3abb29dec880faf6df976cd7f0196a321d /pango/pango-language.c
parent4cf39ece01babd61ccbee37295fbdb77d8ce46cd (diff)
downloadpango-33b83516e17a6a34265d036f9e02b272cd1b436a.tar.gz
pango: Don't fail to initialize if LC_CTYPE is not set
g_once_init_leave() does not work on NULL, and just returns... and all future calls to g_once_init_enter() will block forever. Happens on Android, so let's just fall back to the C locale if there's nothing else we can do. https://bugzilla.gnome.org/show_bug.cgi?id=732276
Diffstat (limited to 'pango/pango-language.c')
-rw-r--r--pango/pango-language.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pango/pango-language.c b/pango/pango-language.c
index 15d5fb64..e9c9d1f4 100644
--- a/pango/pango-language.c
+++ b/pango/pango-language.c
@@ -219,7 +219,14 @@ _pango_get_lc_ctype (void)
return g_strdup (ret);
#else
- return g_strdup (setlocale (LC_CTYPE, NULL));
+ {
+ gchar *lc_ctype = setlocale (LC_CTYPE, NULL);
+
+ if (lc_ctype)
+ return g_strdup (lc_ctype);
+ else
+ return g_strdup ("C");
+ }
#endif
}