aboutsummaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2013-05-10 14:01:46 +0800
committerDaniel Veillard <veillard@redhat.com>2013-05-10 14:01:46 +0800
commit63588f476f2dc89d4c6ef70a474d7230fbf4d45e (patch)
tree6d52a3cca99b189c0c9917b7df083e13a2d7af36 /parser.c
parent1ba80b7b6f1c89873fa319461954727a7bef2441 (diff)
downloadandroid_external_libxml2-63588f476f2dc89d4c6ef70a474d7230fbf4d45e.tar.gz
android_external_libxml2-63588f476f2dc89d4c6ef70a474d7230fbf4d45e.tar.bz2
android_external_libxml2-63588f476f2dc89d4c6ef70a474d7230fbf4d45e.zip
Fix a regression in xmlGetDocCompressMode()
The switch to xzlib had for consequence that the compression level of the input was not gathered anymore in ctxt->input->buf, then the parser compression flags was left to -1 and propagated to the resulting document. Fix the I/O layer to get compression detection in xzlib, then carry it in the input buffer and the resulting document This should fix https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3456
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index 1d478c3d..4a442bb9 100644
--- a/parser.c
+++ b/parser.c
@@ -10681,6 +10681,10 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
ctxt->sax->startDocument(ctxt->userData);
if (ctxt->instate == XML_PARSER_EOF)
return(-1);
+ if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) &&
+ (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) {
+ ctxt->myDoc->compression = ctxt->input->buf->compressed;
+ }
/*
* The Misc part of the Prolog