[xml] Bug in "file" protocol



Hello,

I believe I found a buglet in xmlIO.c (line 295) : if the "file"
protocol contains the host specification "localhost", a leading forward
slash is always included in the path name. This is a problem if the path
contains a Windows drive letter. That is, the URL

        file://localhost/C:/TEMP/foo.xml 

results in a path name of

        /C:/TEMP/foo.xml

The code that handles "file:///" correctly handles Windows-style paths.


Regards,

Daniel Gehriger


xmlIO.c, line 295 :

    if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost",
16))
        path = &filename[16];
    else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8))
{
#if defined (_WIN32) && !defined(__CYGWIN__)
        path = &filename[8];
#else
        path = &filename[7];
#endif
    } else 
        path = filename;




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]