[Fontconfig] patch: fallback to POSIX if LC_CTYPE is the empty string "".

Keith Packard keithp at keithp.com
Wed Aug 17 03:08:04 EST 2005


On Tue, 2005-08-16 at 18:02 +0200, Mike FABIAN wrote:
> A SuSE user recently reported a bug that icewm didn't show any fonts.
> 
> It turned out to be user error, he had set LANG="" (and no
> other locale specific environment variables).

> Although setting LC_CTYPE="" is not a valid setting in my opinion, I
> think fontconfig should fall back to matching an English font in that
> case, just as it does for all the other invalid settings of LC_CTYPE.

It should probably treat an empty lang as if the lang was not set:

Index: fcdefault.c
===================================================================
RCS file: /cvs/fontconfig/fontconfig/src/fcdefault.c,v
retrieving revision 1.7
diff -u -p -r1.7 fcdefault.c
--- fcdefault.c 7 Dec 2004 01:14:46 -0000       1.7
+++ fcdefault.c 16 Aug 2005 17:06:46 -0000
@@ -111,7 +111,8 @@ FcDefaultSubstitute (FcPattern *pattern)
                    ctype = getenv ("LANG");
            }
        }
-       if (ctype)
+       /* ignore missing or empty ctype */
+       if (ctype && *ctype != '\0')
        {
            lang = ctype;
            territory = strchr (ctype, '_');

There's no point setting ctype to 'POSIX'; the only ctypes which have
any effect on the library are those in <lang>_<territory> form.

-keith

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20050816/a4cb8aa3/attachment.pgp


More information about the Fontconfig mailing list