From cb1df8cb28d6ae34726cf7c3fd0142847431c7bb Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Tue, 2 Apr 2019 09:37:49 +0000 Subject: [PATCH] Don't warn if path can't be converted with prefix --- src/fcxml.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/fcxml.c b/src/fcxml.c index 54a26da..d154a54 100644 --- a/src/fcxml.c +++ b/src/fcxml.c @@ -2076,6 +2076,11 @@ FcParseRemapDir (FcConfigParse *parse) FcConfigMessage (parse, FcSevereError, "out of memory"); return; } + if (data[0] == 0) + { + FcConfigMessage (parse, FcSevereWarning, "empty font directory name for remap ignored"); + return; + } path = FcConfigGetAttribute (parse, "as-path"); if (!path) { @@ -2086,7 +2091,9 @@ FcParseRemapDir (FcConfigParse *parse) salt = FcConfigGetAttribute (parse, "salt"); prefix = _get_real_path_from_prefix (parse, data, attr); if (!prefix || prefix[0] == 0) - FcConfigMessage (parse, FcSevereWarning, "empty font directory name for remap ignored"); + { + /* nop */ + } else if (!parse->scanOnly && (!FcStrUsesHome (prefix) || FcConfigHome ())) { if (!FcConfigAddFontDir (parse->config, prefix, path, salt)) @@ -2257,11 +2264,18 @@ FcParseDir (FcConfigParse *parse) FcConfigMessage (parse, FcSevereError, "out of memory"); return; } + if (data[0] == 0) + { + FcConfigMessage (parse, FcSevereWarning, "empty font directory name ignored"); + return; + } attr = FcConfigGetAttribute (parse, "prefix"); salt = FcConfigGetAttribute (parse, "salt"); prefix = _get_real_path_from_prefix (parse, data, attr); if (!prefix || prefix[0] == 0) - FcConfigMessage (parse, FcSevereWarning, "empty font directory name ignored"); + { + /* nop */ + } else if (!parse->scanOnly && (!FcStrUsesHome (prefix) || FcConfigHome ())) { if (!FcConfigAddFontDir (parse->config, prefix, NULL, salt))