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.
This commit is contained in:
parent
83c5c357ab
commit
8ade236923
|
@ -2101,7 +2101,9 @@ FcEndElement(void *userData, const XML_Char *name)
|
||||||
strcat (data, "fonts");
|
strcat (data, "fonts");
|
||||||
}
|
}
|
||||||
#endif
|
#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))
|
if (!FcConfigAddDir (parse->config, data))
|
||||||
FcConfigMessage (parse, FcSevereError, "out of memory; cannot add directory %s", data);
|
FcConfigMessage (parse, FcSevereError, "out of memory; cannot add directory %s", data);
|
||||||
|
|
Loading…
Reference in New Issue