mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
Remove unnecessary calls to xmlPopInput
It's enough if xmlPopInput is called from xmlSkipBlankChars. Since the replacement text of a parameter entity is surrounded with space characters, that's the only place where the replacement can end in a well-formed document. This is also required to get rid of the "blanks wrapper" hack.
This commit is contained in:
@@ -435,8 +435,6 @@ xmlNextChar(xmlParserCtxtPtr ctxt)
|
||||
|
||||
if ((*ctxt->input->cur == 0) &&
|
||||
(xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) {
|
||||
if ((ctxt->instate != XML_PARSER_COMMENT))
|
||||
xmlPopInput(ctxt);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -523,8 +521,6 @@ xmlNextChar(xmlParserCtxtPtr ctxt)
|
||||
ctxt->input->cur++;
|
||||
|
||||
ctxt->nbChars++;
|
||||
if (*ctxt->input->cur == 0)
|
||||
xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
|
||||
} else {
|
||||
/*
|
||||
* Assume it's a fixed length encoding (1) with
|
||||
@@ -538,12 +534,9 @@ xmlNextChar(xmlParserCtxtPtr ctxt)
|
||||
ctxt->input->col++;
|
||||
ctxt->input->cur++;
|
||||
ctxt->nbChars++;
|
||||
if (*ctxt->input->cur == 0)
|
||||
xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
|
||||
}
|
||||
if ((*ctxt->input->cur == 0) &&
|
||||
(xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0))
|
||||
xmlPopInput(ctxt);
|
||||
if (*ctxt->input->cur == 0)
|
||||
xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
|
||||
return;
|
||||
encoding_error:
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user