mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-01 10:06:59 +03:00
Implemented detection of compressed files, setting doc->compressed
* xmlIO.c include/libxml/xmlIO.h parser.c: Implemented detection of compressed files, setting doc->compressed appropriately (bug #120503).
This commit is contained in:
10
parser.c
10
parser.c
@ -2923,7 +2923,7 @@ get_more:
|
||||
SHRINK;
|
||||
GROW;
|
||||
in = ctxt->input->cur;
|
||||
} while ((*in >= 0x20) && (*in <= 0x7F) || (*in == 0x09));
|
||||
} while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09));
|
||||
nbchar = 0;
|
||||
}
|
||||
ctxt->input->line = line;
|
||||
@ -11345,7 +11345,13 @@ xmlSAXParseFileWithData(xmlSAXHandlerPtr sax, const char *filename,
|
||||
|
||||
xmlParseDocument(ctxt);
|
||||
|
||||
if ((ctxt->wellFormed) || recovery) ret = ctxt->myDoc;
|
||||
if ((ctxt->wellFormed) || recovery) {
|
||||
ret = ctxt->myDoc;
|
||||
if (ctxt->input->buf->compressed > 0)
|
||||
ret->compression = 9;
|
||||
else
|
||||
ret->compression = ctxt->input->buf->compressed;
|
||||
}
|
||||
else {
|
||||
ret = NULL;
|
||||
xmlFreeDoc(ctxt->myDoc);
|
||||
|
Reference in New Issue
Block a user