Warn if no <test> nor <edit> elements in <match>
authorAkira TAGOH <akira@tagoh.org>
Thu, 24 Jan 2013 10:48:48 +0000 (19:48 +0900)
committerAkira TAGOH <akira@tagoh.org>
Thu, 31 Oct 2013 12:48:27 +0000 (21:48 +0900)
This corrects an error message being reported at
  https://bugs.freedesktop.org/show_bug.cgi?id=71085
  Bug 71085 - "out of memory" errors on empty match element in fonts.conf

and somewhat works as a workaround for
  https://bugs.freedesktop.org/show_bug.cgi?id=59438
  Bug 59438 - Fix <alias> inside <match>

src/fcxml.c

index 8ff10b6..bd95580 100644 (file)
@@ -2566,6 +2566,11 @@ FcParseMatch (FcConfigParse *parse)
        }
        FcVStackPopAndDestroy (parse);
     }
+    if (!rule)
+    {
+       FcConfigMessage (parse, FcSevereWarning, "No <test> nor <edit> elements in <match>");
+       return;
+    }
     if (!FcConfigAddRule (parse->config, rule, kind))
        FcConfigMessage (parse, FcSevereError, "out of memory");
 }