Re: [xml] Bug in tree.c : xmlSaveFile, xmlSaveFileEnc

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@imag.fr)
Date: Tue Jan 16 2001 - 12:24:19 EST


  Hi Gary,

 sure, right that's a bug, the functions were not in sync with
their comment, your patch is right and has been applied,

  thanks a lot,

Daniel

On Tue, Jan 16, 2001 at 04:44:40PM +0000, Gary Pennington wrote:
>
> Hi,
>
> I'm using libxml2-2.2.11 and I've encountered what I think is a bug in
> the two functions named.
>
> In xmlDocDump, if an output buffer can't be created then -1 is returned
> as per the documentation. However for both xmlSaveFile and
> xmlSaveFileEnc, the return is 0 for the same condition. I think that
> this should be changed so that it is -1 in all these cases if an output
> buffer cannot be created.
>
> I suppose that a return of 0 is kind of correct (since 0 bytes were
> written) but it seems a little misleading to me since there has been an
> error which isn't reported.
>
> I encountered the problem when trying to save a file to a location in
> which I didn't have permission to create files, so I think that
> somewhere inside the guts of the IO mechanism an attempt to open a file
> was rejected with EACCESS.
[...]
>
> This is a trivial bug, but it annoyed me for a few minutes so I think
> that the behaviour should be made consistent between these three
> functions.
>
> Gary

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard@redhat.com  | libxml Gnome XML toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Jan 16 2001 - 12:44:10 EST