[Fontconfig] fontconfig: Branch 'master' - 2 commits

Akira TAGOH tagoh at kemper.freedesktop.org
Thu Jun 21 22:29:59 PDT 2012


 src/fcxml.c |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit e5a59eac905f1ff6ebe6005c257ce3f9f3c4cc6b
Author: Marius Tolzmann <tolzmann at molgen.mpg.de>
Date:   Thu Jun 21 21:01:10 2012 +0200

    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.

diff --git a/src/fcxml.c b/src/fcxml.c
index de391d0..a146068 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -2042,6 +2042,7 @@ FcParseInclude (FcConfigParse *parse)
     FcChar8	    *s;
     const FcChar8   *attr;
     FcBool	    ignore_missing = FcFalse;
+    FcBool	    deprecated = FcFalse;
     FcChar8	    *prefix = NULL;
 
     s = FcStrBufDoneStatic (&parse->pstack->str);
@@ -2053,6 +2054,9 @@ FcParseInclude (FcConfigParse *parse)
     attr = FcConfigGetAttribute (parse, "ignore_missing");
     if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
 	ignore_missing = FcTrue;
+    attr = FcConfigGetAttribute (parse, "deprecated");
+    if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
+        deprecated = FcTrue;
     attr = FcConfigGetAttribute (parse, "prefix");
     if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
 	prefix = FcConfigXdgConfigHome ();
@@ -2078,9 +2082,15 @@ 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.", s);
+        FcChar8 *filename;
+
+        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);
 
commit 3a5e9bc75d7e240ec590c6e50161ee157904d4d6
Author: Marius Tolzmann <tolzmann at molgen.mpg.de>
Date:   Thu Jun 21 21:01:09 2012 +0200

    Fix newline in warning about deprecated config includes

diff --git a/src/fcxml.c b/src/fcxml.c
index b8e4469..de391d0 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -2080,7 +2080,7 @@ FcParseInclude (FcConfigParse *parse)
     {
 	attr = FcConfigGetAttribute (parse, "deprecated");
 	if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
-	    FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.\n", s);
+	    FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.", s);
     }
     FcStrBufDestroy (&parse->pstack->str);
 


More information about the Fontconfig mailing list