--- libxml2-2.6.19-orig/xmlIO.c 2005-04-01 08:15:10.000000000 -0500 +++ libxml2-2.6.19/xmlIO.c 2005-04-09 09:57:46.000000000 -0400 @@ -686,15 +686,22 @@ xmlFileOpen_real (const char *filename) if (path == NULL) return(NULL); - if (!xmlCheckFilename(path)) - return(NULL); #if defined(WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) fd = fopen(path, "rb"); #else fd = fopen(path, "r"); #endif /* WIN32 */ - if (fd == NULL) xmlIOErr(0, path); + if (fd == NULL) { + /* NOTE: libxml2 does not raise an error on non-existent files */ +#ifdef HAVE_ERRNO_H + if (ENOENT != errno) +#else + if (xmlCheckFilename(path)) +#endif + xmlIOErr(0, path); + } + return((void *) fd); } @@ -915,10 +922,18 @@ xmlGzfileOpen_real (const char *filename if (path == NULL) return(NULL); - if (!xmlCheckFilename(path)) - return(NULL); fd = gzopen(path, "rb"); + if (fd == NULL) { + /* NOTE: libxml2 does not raise an error on non-existent files */ +#ifdef HAVE_ERRNO_H + if (ENOENT != errno) +#else + if (xmlCheckFilename(path)) +#endif + xmlIOErr(0, path); + } + return((void *) fd); }