mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-07 06:43:02 +03:00
fixed a push/encoding bug reported by Michael on librsvg Daniel
* parser.c: fixed a push/encoding bug reported by Michael on librsvg Daniel
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
Wed Feb 20 23:16:08 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* parser.c: fixed a push/encoding bug reported by Michael
|
||||||
|
on librsvg
|
||||||
|
|
||||||
Wed Feb 20 19:54:05 CET 2002 Daniel Veillard <daniel@veillard.com>
|
Wed Feb 20 19:54:05 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* include/libxml/parserInternals.h: fixes a misplaced #endif
|
* include/libxml/parserInternals.h: fixes a misplaced #endif
|
||||||
|
24
parser.c
24
parser.c
@@ -7929,8 +7929,28 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
|
|||||||
if (ctxt->input ==NULL) break;
|
if (ctxt->input ==NULL) break;
|
||||||
if (ctxt->input->buf == NULL)
|
if (ctxt->input->buf == NULL)
|
||||||
avail = ctxt->input->length - (ctxt->input->cur - ctxt->input->base);
|
avail = ctxt->input->length - (ctxt->input->cur - ctxt->input->base);
|
||||||
else
|
else {
|
||||||
avail = ctxt->input->buf->buffer->use - (ctxt->input->cur - ctxt->input->base);
|
/*
|
||||||
|
* If we are operating on converted input, try to flush
|
||||||
|
* remainng chars to avoid them stalling in the non-converted
|
||||||
|
* buffer.
|
||||||
|
*/
|
||||||
|
if ((ctxt->input->buf->raw != NULL) &&
|
||||||
|
(ctxt->input->buf->raw->use > 0)) {
|
||||||
|
int base = ctxt->input->base -
|
||||||
|
ctxt->input->buf->buffer->content;
|
||||||
|
int current = ctxt->input->cur - ctxt->input->base;
|
||||||
|
|
||||||
|
xmlParserInputBufferPush(ctxt->input->buf, 0, "");
|
||||||
|
ctxt->input->base = ctxt->input->buf->buffer->content + base;
|
||||||
|
ctxt->input->cur = ctxt->input->base + current;
|
||||||
|
ctxt->input->end =
|
||||||
|
&ctxt->input->buf->buffer->content[
|
||||||
|
ctxt->input->buf->buffer->use];
|
||||||
|
}
|
||||||
|
avail = ctxt->input->buf->buffer->use -
|
||||||
|
(ctxt->input->cur - ctxt->input->base);
|
||||||
|
}
|
||||||
if (avail < 1)
|
if (avail < 1)
|
||||||
goto done;
|
goto done;
|
||||||
switch (ctxt->instate) {
|
switch (ctxt->instate) {
|
||||||
|
Reference in New Issue
Block a user