--- parser3/src/main/pa_xml_io.C 2003/11/28 10:41:11 1.10 +++ parser3/src/main/pa_xml_io.C 2003/12/01 09:35:38 1.12 @@ -9,7 +9,7 @@ #ifdef XML -static const char * const IDENT="$Date: 2003/11/28 10:41:11 $"; +static const char * const IDENT="$Date: 2003/12/01 09:35:38 $"; #include "libxslt/extensions.h" @@ -40,7 +40,7 @@ struct MemoryStream { #ifdef PA_SAFE_MODE static int xmlFileMatchSafeMode(const char* file_spec_cstr) { - if(strstr(filename, "://")) { + if(strstr(file_spec_cstr, "://")) { String* file_spec=new String(file_spec_cstr, true); struct stat finfo; if(stat(file_spec_cstr, &finfo)!=0) @@ -95,11 +95,13 @@ xmlFileOpenLocalhost (const char* filena strcat(path, document_root); strcat(path, &filename[16]); - MemoryStream *stream=new(UseGC) MemoryStream; - stream->m_buf=file_read_text(r.charsets, *new String(filename), true); - stream->m_size=strlen(stream->m_buf); - - return (void *)stream; + if(char *buf=file_read_text(r.charsets, *new String(path), false)) { + MemoryStream *stream=new(UseGC) MemoryStream; + stream->m_buf=buf + stream->m_size=strlen(buf); + return (void *)stream; + } else + return 0; } static int