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:
parent
bbc8fb5ba7
commit
2261a64ce1
|
@ -46,13 +46,13 @@ FcGetDefaultLangs (void)
|
||||||
char *langs;
|
char *langs;
|
||||||
|
|
||||||
langs = getenv ("FC_LANG");
|
langs = getenv ("FC_LANG");
|
||||||
if (!langs)
|
if (!langs || !langs[0])
|
||||||
langs = getenv ("LC_ALL");
|
langs = getenv ("LC_ALL");
|
||||||
if (!langs)
|
if (!langs || !langs[0])
|
||||||
langs = getenv ("LC_CTYPE");
|
langs = getenv ("LC_CTYPE");
|
||||||
if (!langs)
|
if (!langs || !langs[0])
|
||||||
langs = getenv ("LANG");
|
langs = getenv ("LANG");
|
||||||
if (langs)
|
if (langs && langs[0])
|
||||||
{
|
{
|
||||||
if (!FcStrSetAddLangs (result, langs))
|
if (!FcStrSetAddLangs (result, langs))
|
||||||
FcStrSetAdd (result, (const FcChar8 *) "en");
|
FcStrSetAdd (result, (const FcChar8 *) "en");
|
||||||
|
|
Loading…
Reference in New Issue