fcdefault: fallback if the environment variables are empty

try to fallback if FC_LANG, LC_ALL, LC_CTYPE and LANG is empty
This commit is contained in:
Akira TAGOH 2012-06-08 15:47:52 +09:00
parent bbc8fb5ba7
commit 2261a64ce1
1 changed files with 4 additions and 4 deletions

View File

@ -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");