Warn if no <test> nor <edit> elements in <match>

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>
This commit is contained in:
Akira TAGOH 2013-01-24 19:48:48 +09:00
parent 525a135ccf
commit aa22e6e639
1 changed files with 5 additions and 0 deletions

View File

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