diff options
author | Akira TAGOH <akira@tagoh.org> | 2012-06-08 15:47:52 +0900 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2012-06-08 15:47:52 +0900 |
commit | 2261a64ce14d692f7c553f46e2158e70400dbc9c (patch) | |
tree | 04da0a3881fb5a2abbcf959eaf2e8e43f95c168b | |
parent | bbc8fb5ba705e5257693f3b266fce12d2f81b50c (diff) | |
download | fontconfig-2261a64ce14d692f7c553f46e2158e70400dbc9c.tar.gz |
fcdefault: fallback if the environment variables are empty
try to fallback if FC_LANG, LC_ALL, LC_CTYPE and LANG is empty
-rw-r--r-- | src/fcdefault.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fcdefault.c b/src/fcdefault.c index 674374c..ce90a88 100644 --- a/src/fcdefault.c +++ b/src/fcdefault.c @@ -46,13 +46,13 @@ FcGetDefaultLangs (void) char *langs; langs = getenv ("FC_LANG"); - if (!langs) + if (!langs || !langs[0]) langs = getenv ("LC_ALL"); - if (!langs) + if (!langs || !langs[0]) langs = getenv ("LC_CTYPE"); - if (!langs) + if (!langs || !langs[0]) langs = getenv ("LANG"); - if (langs) + if (langs && langs[0]) { if (!FcStrSetAddLangs (result, langs)) FcStrSetAdd (result, (const FcChar8 *) "en"); |