X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=src%2Ffcdefault.c;h=4e5823bb13406762b5c9fc3e2e5a2bf8a5fd6405;hb=5d2f7a9d9224d4df1655cd1d6fd72646734b0272;hp=ddf4237e1bbfe6b4c0101eeda1e9c7a8690d3727;hpb=f6cfbe16bfc252b46532f699b496e4a41a1a1c22;p=fontconfig.git diff --git a/src/fcdefault.c b/src/fcdefault.c index ddf4237..4e5823b 100644 --- a/src/fcdefault.c +++ b/src/fcdefault.c @@ -91,6 +91,22 @@ FcGetDefaultLang (void) lang_local[lang_len + 1 + territory_len] = '\0'; } } + else + { + after = strchr (ctype, '.'); + if (!after) + { + after = strchr (ctype, '@'); + if (!after) + after = ctype + strlen (ctype); + } + lang_len = after - ctype; + if (lang_len + 1 <= (int) sizeof (lang_local)) + { + strncpy (lang_local, ctype, lang_len); + lang_local[lang_len] = '\0'; + } + } } /* set default lang to en */