diff --git a/parser.c b/parser.c index 7796cb51..d923b8ee 100644 --- a/parser.c +++ b/parser.c @@ -10659,16 +10659,16 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) { void xmlParseMisc(xmlParserCtxtPtr ctxt) { - while ((ctxt->instate != XML_PARSER_EOF) && - (((RAW == '<') && (NXT(1) == '?')) || - (CMP4(CUR_PTR, '<', '!', '-', '-')) || - IS_BLANK_CH(CUR))) { + while (ctxt->instate != XML_PARSER_EOF) { + SKIP_BLANKS; + GROW; if ((RAW == '<') && (NXT(1) == '?')) { xmlParsePI(ctxt); - } else if (IS_BLANK_CH(CUR)) { - NEXT; - } else + } else if (CMP4(CUR_PTR, '<', '!', '-', '-')) { xmlParseComment(ctxt); + } else { + break; + } } } @@ -10774,7 +10774,6 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { /* * The Misc part of the Prolog */ - GROW; xmlParseMisc(ctxt); /*