summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-05-24 17:14:24 -0700
committerKeith Packard <keithp@keithp.com>2008-05-24 17:14:24 -0700
commit8ade2369238a0b439192a847f12fcc9748a6d73a (patch)
tree85b464a3eadcedf68860912a5065773c7d670428
parent83c5c357abc8d626680943537b4dbc020d6c378c (diff)
Ignore empty <dir></dir> elements
An empty element would cause every file starting with the current directory to be scanned, probably not what the user wanted.
-rw-r--r--src/fcxml.c4
1 files changed, 3 insertions, 1 deletions
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);