1
0
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:
William M. Brack
2003-09-08 01:57:30 +00:00
parent f2a941fc1e
commit c07329e2ab
4 changed files with 31 additions and 12 deletions

View File

@ -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);