[Fontconfig] [PATCH 1/2] Fix warning about depracted config includes if ignore_missing is true

Marius Tolzmann tolzmann at molgen.mpg.de
Thu Jun 21 03:04:22 PDT 2012


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.

Since ignore_missing="yes" is set in the config file it may be polite
to not issue the warning if ~/.fonts.conf.d and/or ~/.fonts.conf do
not exist.
---
 src/fcxml.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/fcxml.c b/src/fcxml.c
index b8e4469..6eb089d 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -2078,9 +2078,13 @@ FcParseInclude (FcConfigParse *parse)
 	parse->error = FcTrue;
     else
     {
-	attr = FcConfigGetAttribute (parse, "deprecated");
-	if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
-	    FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.\n", s);
+        attr = FcConfigGetAttribute (parse, "deprecated");
+        if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
+        {
+            struct stat statb;
+            if (ignore_missing == FcFalse || FcStat(s, &statb) == 0)
+                FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.\n", s);
+        }
     }
     FcStrBufDestroy (&parse->pstack->str);
 
-- 
1.7.5.2



More information about the Fontconfig mailing list