1 diff -ur libxml2-2.4.20/xmlIO.c libxml2-2.4.20-/xmlIO.c
2 --- libxml2-2.4.20/xmlIO.c Wed Mar 27 04:35:12 2002
3 +++ libxml2-2.4.20-/xmlIO.c Thu May 23 20:35:12 2002
8 - if (!xmlCheckFilename(path))
11 + if (!xmlCheckFilename(path)) {
12 + /* If we cannot open `foo.xml', we try `foo.xml.gz'. However we i
13 + * append .gz only if filename doesn't alreay end with .gz. */
14 + if (strlen(path) < 3 || strcmp(path + strlen(path) - 3, ".gz") != 0) {
15 + char *gz_filename = xmlMalloc(strlen(path) + 4);
17 + if (gz_filename == NULL) {
18 + xmlGenericError(xmlGenericErrorContext,
19 + "xmlGzfileOpen: %s\n",
20 + "Failure allocating buffer for filename.");
24 + strcpy(gz_filename, path);
25 + strcat(gz_filename, ".gz");
29 + if (xmlCheckFilename(gz_filename))
30 + fd = gzopen(gz_filename, "rb");
32 + xmlFree(gz_filename);
34 + return((void *) fd);
40 fd = gzopen(path, "rb");