summaryrefslogtreecommitdiff
path: root/parserInternals.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2017-06-19 17:55:20 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2017-06-20 13:19:47 +0200
commit453dff1e3b6f7aa724c4996a375c51df6d95abc4 (patch)
tree0fc72fdf74755f99986367ca31830d94473185e8 /parserInternals.c
parentaa267cd12752f2ff94b0f0c01e2adc30a7913ad4 (diff)
downloadlibxml2-453dff1e3b6f7aa724c4996a375c51df6d95abc4.tar.gz
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.
Diffstat (limited to 'parserInternals.c')
-rw-r--r--parserInternals.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/parserInternals.c b/parserInternals.c
index 7593fc74..d98227c6 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -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:
/*