Re: [xml] Clarification regarding Input Parameter handlin



On Tue, Aug 14, 2007 at 02:47:34PM +0530, Ashwin wrote:

   Hi,


             The Libxml2 function xmlSAXUserParseMemory( ) does not allow
   the  input parameter sax to be input as a NULL pointer but whereas the
   Libxml2 function xmlSAXUserParseFile( ) doesn't have the check for the
   same,  it copies the SAX pointer to the context even if it is NULL, is
   this behavior correct?

  Hum, I can't think of a good reason why the behaviour of both functions
differ, it sounds more like an historical bug (i.e. having sax == NULL may
have triggered a bug). The best is probably to clean up xmlSAXUserParseMemory
by using the same initialization steps, as I would expect xmlSAXUserParseFile
to have had a lot of use over the years (which unfortunately is not a guarantee
but still helps trusting it).
   So I have modified xmlSAXUserParseMemory() to do the same as 
xmlSAXUserParseFile(), and also removed the #ifdef LIBXML_SAX1_ENABLED
conditional for both functions since they are only included if
LIBXML_SAX1_ENABLED is defined. This passed all the test suites, so I commited
this in SVN !

  thanks for the review !

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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