aboutsummaryrefslogtreecommitdiff
path: root/fontconfig
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig')
-rw-r--r--fontconfig/fonts.dtd2
-rw-r--r--fontconfig/src/fcxml.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/fontconfig/fonts.dtd b/fontconfig/fonts.dtd
index 4c38e77f0..479f2c0fb 100644
--- a/fontconfig/fonts.dtd
+++ b/fontconfig/fonts.dtd
@@ -140,7 +140,7 @@
if 'target' is 'font', execute the match on the result of a font
selection.
-->
-<!ELEMENT match (test*, edit*)+>
+<!ELEMENT match (test|edit)+>
<!ATTLIST match
target (pattern|font|scan) "pattern">
diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c
index 8ff10b6e6..bd95580aa 100644
--- a/fontconfig/src/fcxml.c
+++ b/fontconfig/src/fcxml.c
@@ -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");
}