[libxml2] Fix HTML push parser to accept HTML_PARSE_NODEFDTD
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Fix HTML push parser to accept HTML_PARSE_NODEFDTD
- Date: Fri, 29 Nov 2013 06:13:56 +0000 (UTC)
commit 826bc320206f70fccd2941a77d363e95e8076898
Author: Arnold Hendriks <a hendriks b-lex nl>
Date: Fri Nov 29 14:12:12 2013 +0800
Fix HTML push parser to accept HTML_PARSE_NODEFDTD
For https://bugzilla.gnome.org/show_bug.cgi?id=719515
fixes htmlParseTryOrFinish to interpret HTML_PARSE_NODEFDTD,
and updates xmllint to actually pass --nodefdtd to the push
version of the HTML parser
HTMLparser.c | 2 +-
xmllint.c | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/HTMLparser.c b/HTMLparser.c
index dd0c1ea..7694962 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -5991,7 +5991,7 @@ done:
ctxt->sax->endDocument(ctxt->userData);
}
}
- if ((ctxt->myDoc != NULL) &&
+ if ((!(ctxt->options & HTML_PARSE_NODEFDTD)) && (ctxt->myDoc != NULL) &&
((terminate) || (ctxt->instate == XML_PARSER_EOF) ||
(ctxt->instate == XML_PARSER_EPILOG))) {
xmlDtdPtr dtd;
diff --git a/xmllint.c b/xmllint.c
index d69722c..ebd36ab 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -2206,6 +2206,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
if (res > 0) {
ctxt = htmlCreatePushParserCtxt(NULL, NULL,
chars, res, filename, XML_CHAR_ENCODING_NONE);
+ xmlCtxtUseOptions(ctxt, options);
while ((res = fread(chars, 1, pushsize, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]