summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2006-01-14 18:38:42 +0100
committerMike Hommey <glandium@debian.org>2006-01-14 18:38:42 +0100
commit770a03b6ddfca9fb632133998be981c07145d4ba (patch)
tree33292edda2dab52ff3578fd8f08796d01e38e289
parentd8b69a37192e329d379433775d977c26cdf8b423 (diff)
downloadlibxml2-770a03b6ddfca9fb632133998be981c07145d4ba.tar.gz
Import NMU changesdebian/2.6.23-1.1
-rw-r--r--debian/changelog7
-rw-r--r--parser.c17
2 files changed, 18 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index 45eb473..aef992c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libxml2 (2.6.23-1.1) unstable; urgency=high
+
+ * Non-maintainer upload.
+ * Fix XML parser to unbreak xsltproc (Closes: #346594).
+
+ -- Luk Claes <luk@debian.org> Thu, 12 Jan 2006 15:25:42 +0100
+
libxml2 (2.6.23-1) unstable; urgency=low
* New upstream release
diff --git a/parser.c b/parser.c
index ec7fb53..03caa9d 100644
--- a/parser.c
+++ b/parser.c
@@ -3539,16 +3539,12 @@ get_more:
ctxt->input->cur = in;
if (*in == 0xD) {
in++;
- if (!*in) /* if end of current chunk return */
- return;
if (*in == 0xA) {
ctxt->input->cur = in;
in++;
ctxt->input->line++; ctxt->input->col = 1;
continue; /* while */
}
- if (!*in) /* if end of current chunk return */
- return;
in--;
}
if (*in == '<') {
@@ -3931,8 +3927,6 @@ get_more:
ctxt->input->line++; ctxt->input->col = 1;
continue; /* while */
}
- if (!*in) /* if end of current chunk return */
- return;
in--;
}
SHRINK;
@@ -10407,12 +10401,19 @@ encoding_error:
int
xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size,
int terminate) {
+ int end_in_lf = 0;
+
if (ctxt == NULL)
return(XML_ERR_INTERNAL_ERROR);
if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1))
return(ctxt->errNo);
if (ctxt->instate == XML_PARSER_START)
xmlDetectSAX2(ctxt);
+ if ((size > 0) && (chunk != NULL) && (!terminate) &&
+ (chunk[size - 1] == '\r')) {
+ end_in_lf = 1;
+ size--;
+ }
if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) &&
(ctxt->input->buf != NULL) && (ctxt->instate != XML_PARSER_EOF)) {
int base = ctxt->input->base - ctxt->input->buf->buffer->content;
@@ -10451,6 +10452,10 @@ xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size,
}
}
xmlParseTryOrFinish(ctxt, terminate);
+ if ((end_in_lf == 1) && (ctxt->input != NULL) &&
+ (ctxt->input->buf != NULL)) {
+ xmlParserInputBufferPush(ctxt->input->buf, 1, "\r");
+ }
if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1))
return(ctxt->errNo);
if (terminate) {