From: Keith Packard Date: Sun, 25 May 2008 00:14:24 +0000 (-0700) Subject: Ignore empty elements X-Git-Tag: 2.5.93~1 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=8ade2369238a0b439192a847f12fcc9748a6d73a;p=fontconfig.git Ignore empty elements An empty element would cause every file starting with the current directory to be scanned, probably not what the user wanted. --- diff --git a/src/fcxml.c b/src/fcxml.c index a2cc02e..90c079a 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -2101,7 +2101,9 @@ FcEndElement(void *userData, const XML_Char *name) strcat (data, "fonts"); } #endif - if (!FcStrUsesHome (data) || FcConfigHome ()) + if (strlen ((char *) data) == 0) + FcConfigMessage (parse, FcSevereWarning, "empty font directory name ignored"); + else if (!FcStrUsesHome (data) || FcConfigHome ()) { if (!FcConfigAddDir (parse->config, data)) FcConfigMessage (parse, FcSevereError, "out of memory; cannot add directory %s", data);