diff options
| author | Koop Mast <kwm@FreeBSD.org> | 2015-11-02 13:41:03 +0000 |
|---|---|---|
| committer | Koop Mast <kwm@FreeBSD.org> | 2015-11-02 13:41:03 +0000 |
| commit | 022cafac8f76f9f758af6d690b700730e3852a7d (patch) | |
| tree | e5ec890a847ca29179d76fa4197b5a72a6f88863 /x11-fonts/fontconfig/files/patch-src_fclang.c | |
| parent | The intel kernel driver leaks error code "512" (ERESTARTSYS) to (diff) | |
Teach fontconfig that LANG and LC_* settings with more than 2 components
are fine and actualy supported by POSIX even if Linux doesn't.
This should fix font issues with the projects/collation branch.
Submitted by: bapt@, marino@
Obtained from: DragonFly BSD
Notes
Notes:
svn path=/head/; revision=400653
Diffstat (limited to 'x11-fonts/fontconfig/files/patch-src_fclang.c')
| -rw-r--r-- | x11-fonts/fontconfig/files/patch-src_fclang.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/x11-fonts/fontconfig/files/patch-src_fclang.c b/x11-fonts/fontconfig/files/patch-src_fclang.c new file mode 100644 index 000000000000..f6664827b457 --- /dev/null +++ b/x11-fonts/fontconfig/files/patch-src_fclang.c @@ -0,0 +1,50 @@ +--- src/fclang.c.orig 2014-01-20 08:14:20 UTC ++++ src/fclang.c +@@ -183,6 +183,7 @@ FcLangNormalize (const FcChar8 *lang) + { + FcChar8 *result = NULL, *s, *orig; + char *territory, *encoding, *modifier; ++ char *script; + size_t llen, tlen = 0, mlen = 0; + + if (!lang || !*lang) +@@ -241,26 +242,32 @@ FcLangNormalize (const FcChar8 *lang) + modifier = encoding; + } + } +- territory = strchr ((const char *) s, '_'); +- if (!territory) +- territory = strchr ((const char *) s, '-'); ++ territory = strrchr ((const char *) s, '_'); + if (territory) + { + *territory = 0; + territory++; + tlen = strlen (territory); + } ++ /* There might by a script component, e.g. sr_Cyrl_RS@UTF-8. We can't assume all legal locale ++ names are in the form <lang>_<country code>.<encoding>. If the script component is here, ++ skip it to define the language properly (e.g. "sr" instead of "sr_Cyrl") */ ++ script = strchr ((const char *) s, '_'); ++ if (script) ++ { ++ *script = 0; ++ } + llen = strlen ((const char *) s); + if (llen < 2 || llen > 3) + { +- fprintf (stderr, "Fontconfig warning: ignoring %s: not a valid language tag\n", +- lang); ++ fprintf (stderr, "Fontconfig warning: ignoring %s: not a valid language tag (%s)\n", ++ s, lang); + goto bail0; + } + if (territory && (tlen < 2 || tlen > 3)) + { +- fprintf (stderr, "Fontconfig warning: ignoring %s: not a valid region tag\n", +- lang); ++ fprintf (stderr, "Fontconfig warning: ignoring %s: not a valid region tag (%s)\n", ++ territory, lang); + goto bail0; + } + if (territory) |
