[xml] Bug in "file" protocol


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


results in a path name of


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


Daniel Gehriger

xmlIO.c, line 295 :

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

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