Skip to content

Commit

Permalink
Revert "Change calls to xmlCharEncInput to set flush false"
Browse files Browse the repository at this point in the history
This reverts commit 6e6ae5d which
broke decoding of larger documents with ICU.

See https://bugs.chromium.org/p/chromium/issues/detail?id=820163
  • Loading branch information
nwellnhof committed Mar 16, 2018
1 parent 7abec67 commit 7a1bd7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion HTMLparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -3635,7 +3635,7 @@ htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) {
*/
processed = ctxt->input->cur - ctxt->input->base;
xmlBufShrink(ctxt->input->buf->buffer, processed);
nbchars = xmlCharEncInput(ctxt->input->buf, 0);
nbchars = xmlCharEncInput(ctxt->input->buf, 1);
if (nbchars < 0) {
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
"htmlCheckEncoding: encoder error\n",
Expand Down
2 changes: 1 addition & 1 deletion parserInternals.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
/*
* convert as much as possible of the buffer
*/
nbchars = xmlCharEncInput(input->buf, 0);
nbchars = xmlCharEncInput(input->buf, 1);
} else {
/*
* convert just enough to get
Expand Down
4 changes: 2 additions & 2 deletions xmlIO.c
Original file line number Diff line number Diff line change
Expand Up @@ -3157,7 +3157,7 @@ xmlParserInputBufferPush(xmlParserInputBufferPtr in,
* convert as much as possible to the parser reading buffer.
*/
use = xmlBufUse(in->raw);
nbchars = xmlCharEncInput(in, 0);
nbchars = xmlCharEncInput(in, 1);
if (nbchars < 0) {
xmlIOErr(XML_IO_ENCODER, NULL);
in->error = XML_IO_ENCODER;
Expand Down Expand Up @@ -3273,7 +3273,7 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
* convert as much as possible to the parser reading buffer.
*/
use = xmlBufUse(in->raw);
nbchars = xmlCharEncInput(in, 0);
nbchars = xmlCharEncInput(in, 1);
if (nbchars < 0) {
xmlIOErr(XML_IO_ENCODER, NULL);
in->error = XML_IO_ENCODER;
Expand Down

0 comments on commit 7a1bd7f

Please sign in to comment.