From 8ade2369238a0b439192a847f12fcc9748a6d73a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 24 May 2008 17:14:24 -0700 Subject: [PATCH] Ignore empty elements An empty element would cause every file starting with the current directory to be scanned, probably not what the user wanted. --- src/fcxml.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.39.5