diff options
author | Andrew Shadura <bugzilla@tut.by> | 2012-01-09 11:06:33 +0300 |
---|---|---|
committer | Andrew Shadura <bugzilla@tut.by> | 2012-01-09 11:06:33 +0300 |
commit | a8052e0399d1169ba919f75678a3a7cee733f7d8 (patch) | |
tree | a71269b4e3eba210ec76f042a6403f00fe9c85b2 /parser.c | |
parent | 899ee095d980f49d84de15cdbcfaadb1f65e10ec (diff) | |
parent | b4af3ef034e84af1c5d95391d9aa9eab608c43f5 (diff) | |
download | libxml2-a8052e0399d1169ba919f75678a3a7cee733f7d8.tar.gz |
merge
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -4949,7 +4949,8 @@ xmlParsePI(xmlParserCtxtPtr ctxt) { (ctxt->sax->processingInstruction != NULL)) ctxt->sax->processingInstruction(ctxt->userData, target, NULL); - ctxt->instate = state; + if (ctxt->instate != XML_PARSER_EOF) + ctxt->instate = state; return; } buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); @@ -5029,7 +5030,8 @@ xmlParsePI(xmlParserCtxtPtr ctxt) { } else { xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL); } - ctxt->instate = state; + if (ctxt->instate != XML_PARSER_EOF) + ctxt->instate = state; } } @@ -9588,6 +9590,8 @@ xmlParseElement(xmlParserCtxtPtr ctxt) { else name = xmlParseStartTag(ctxt); #endif /* LIBXML_SAX1_ENABLED */ + if (ctxt->instate == XML_PARSER_EOF) + return; if (name == NULL) { spacePop(ctxt); return; @@ -10967,6 +10971,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { else name = xmlParseStartTag(ctxt); #endif /* LIBXML_SAX1_ENABLED */ + if (ctxt->instate == XML_PARSER_EOF) + goto done; if (name == NULL) { spacePop(ctxt); ctxt->instate = XML_PARSER_EOF; @@ -11153,7 +11159,9 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { else xmlParseEndTag1(ctxt, 0); #endif /* LIBXML_SAX1_ENABLED */ - if (ctxt->nameNr == 0) { + if (ctxt->instate == XML_PARSER_EOF) { + /* Nothing */ + } else if (ctxt->nameNr == 0) { ctxt->instate = XML_PARSER_EPILOG; } else { ctxt->instate = XML_PARSER_CONTENT; |