List Info

Thread: Re: xmlReadFile with filename instead of URL?




Re: xmlReadFile with filename instead of URL?
user name
2007-03-30 07:43:09
On Fri, Mar 30, 2007 at 09:43:43AM +1000, Michael Day
wrote:
> >The behaviour only seems to trigger when you
configure --without-zlib. I 
> >don't know why yet, but there are zlib specific
#ifdefs in the loading 
> >and URL mangling code, so there could be something
funny going on that 
> >isn't triggered when zlib is disabled.
> 
> Okay, I found the bug, it's very simple.

  haha  Cool !

[...]
> So I suggest this patch to xmlFileOpen in xmlIO.c:
> 
>     retval = xmlFileOpen_real(filename);
>     if (retval == NULL) {
>         unescaped = xmlURIUnescapeString(filename, 0,
NULL);
>         if (unescaped != NULL) {
>             retval = xmlFileOpen_real(unescaped);
>             xmlFree(unescaped);
>         }
>     }
>     return retval;
> 
> With this code the file "hello%2Fworld.xml"
will be loaded first, and 
> only if it is not found will
"hello/world.xml" be loaded. But yeah, I 
> would rather delete that entire if test, as it seems to
me that any URL 
> unescaping should be handled a lot earlier before
xmlFileOpen sees it.

  Sounds better I made the change in SVN,

   thanks a lot !

Daniel

-- 
Red Hat Virtualization group http://redhat.com/v
irtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillardredhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ |
Rpmfind RPM search engine  http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )