Commit e5a59eac authored by Marius Tolzmann's avatar Marius Tolzmann Committed by Akira TAGOH

Fix warning about deprecated, non-existent config includes

Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 8: reading configurations from ~/.fonts.conf.d is deprecated.

Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.

Be polite and do not issue the warning if deprecated config includes
(e.g. ~/.fonts.conf.d and/or ~/.fonts.conf) do not exist.
parent 3a5e9bc7
...@@ -2042,6 +2042,7 @@ FcParseInclude (FcConfigParse *parse) ...@@ -2042,6 +2042,7 @@ FcParseInclude (FcConfigParse *parse)
FcChar8 *s; FcChar8 *s;
const FcChar8 *attr; const FcChar8 *attr;
FcBool ignore_missing = FcFalse; FcBool ignore_missing = FcFalse;
FcBool deprecated = FcFalse;
FcChar8 *prefix = NULL; FcChar8 *prefix = NULL;
s = FcStrBufDoneStatic (&parse->pstack->str); s = FcStrBufDoneStatic (&parse->pstack->str);
...@@ -2053,6 +2054,9 @@ FcParseInclude (FcConfigParse *parse) ...@@ -2053,6 +2054,9 @@ FcParseInclude (FcConfigParse *parse)
attr = FcConfigGetAttribute (parse, "ignore_missing"); attr = FcConfigGetAttribute (parse, "ignore_missing");
if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue) if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
ignore_missing = FcTrue; ignore_missing = FcTrue;
attr = FcConfigGetAttribute (parse, "deprecated");
if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
deprecated = FcTrue;
attr = FcConfigGetAttribute (parse, "prefix"); attr = FcConfigGetAttribute (parse, "prefix");
if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0) if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
prefix = FcConfigXdgConfigHome (); prefix = FcConfigXdgConfigHome ();
...@@ -2078,9 +2082,15 @@ FcParseInclude (FcConfigParse *parse) ...@@ -2078,9 +2082,15 @@ FcParseInclude (FcConfigParse *parse)
parse->error = FcTrue; parse->error = FcTrue;
else else
{ {
attr = FcConfigGetAttribute (parse, "deprecated"); FcChar8 *filename;
if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.", s); filename = FcConfigFilename(s);
if ((deprecated == FcTrue) && filename)
{
FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.", s);
}
if(filename)
FcStrFree(filename);
} }
FcStrBufDestroy (&parse->pstack->str); FcStrBufDestroy (&parse->pstack->str);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment