diff --git a/ChangeLog b/ChangeLog index ea965748..487405eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Jun 11 10:07:29 CEST 2001 Daniel Veillard + + * xmlversion.h.in libxml.h: Cygwin patches + * tree.c: xmlFreeNodeList patch similar to xmlFreeNode one + * tree.h: cleanup + Sat Jun 9 19:16:00 CEST 2001 Daniel Veillard * tree.c: patched xmlFreeNode() to avoid freeing() a static diff --git a/include/libxml/tree.h b/include/libxml/tree.h index b13b0bc8..272d21cc 100644 --- a/include/libxml/tree.h +++ b/include/libxml/tree.h @@ -69,16 +69,6 @@ typedef enum { typedef unsigned char xmlChar; -/* - * Removed in 2.3.9 ... nobody should still use this - * -#ifndef WIN32 -#ifndef CHAR -#define CHAR xmlChar -#endif -#endif - */ - /** * BAD_CAST: * diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in index 57251234..1c6bdb00 100644 --- a/include/libxml/xmlversion.h.in +++ b/include/libxml/xmlversion.h.in @@ -129,7 +129,7 @@ extern void xmlCheckVersion(int version); * * Whether iconv support is available */ -#ifndef WIN32 +#if !defined(WIN32) || defined(__CYGWIN__) #if @WITH_ICONV@ #define LIBXML_ICONV_ENABLED #else diff --git a/libxml.h b/libxml.h index ded5d373..647768c0 100644 --- a/libxml.h +++ b/libxml.h @@ -9,7 +9,7 @@ #ifndef __XML_LIBXML_H__ #define __XML_LIBXML_H__ -#ifdef WIN32 +#if !defined(WIN32) || defined(__CYGWIN__) #include "win32config.h" #else #include "config.h" diff --git a/tree.c b/tree.c index 670c1396..b881eced 100644 --- a/tree.c +++ b/tree.c @@ -2369,11 +2369,30 @@ xmlFreeNodeList(xmlNodePtr cur) { #else if (cur->content != NULL) xmlBufferFree(cur->content); #endif + /* + * When a node is a text node or a comment, it uses a global static + * variable for the name of the node. + * + * The xmlStrEqual comparisons need to be done when (happened with + * XML::libXML and XML::libXSLT) the library is included twice + * statically in the binary and a tree allocated by one occurent + * of the lib gets freed by the other occurence, in this case + * the string addresses compare are not sufficient. + */ if ((cur->name != NULL) && (cur->name != xmlStringText) && (cur->name != xmlStringTextNoenc) && - (cur->name != xmlStringComment)) - xmlFree((char *) cur->name); + (cur->name != xmlStringComment)) { + if (cur->type == XML_TEXT_NODE) { + if ((!xmlStrEqual(cur->name, xmlStringText)) && + (!xmlStrEqual(cur->name, xmlStringTextNoenc))) + xmlFree((char *) cur->name); + } else if (cur->type == XML_COMMENT_NODE) { + if (!xmlStrEqual(cur->name, xmlStringComment)) + xmlFree((char *) cur->name); + } else + xmlFree((char *) cur->name); + } /* TODO : derecursivate this function */ if (cur->nsDef != NULL) xmlFreeNsList(cur->nsDef); xmlFree(cur); diff --git a/tree.h b/tree.h index b13b0bc8..272d21cc 100644 --- a/tree.h +++ b/tree.h @@ -69,16 +69,6 @@ typedef enum { typedef unsigned char xmlChar; -/* - * Removed in 2.3.9 ... nobody should still use this - * -#ifndef WIN32 -#ifndef CHAR -#define CHAR xmlChar -#endif -#endif - */ - /** * BAD_CAST: * diff --git a/xmlversion.h.in b/xmlversion.h.in index 57251234..1c6bdb00 100644 --- a/xmlversion.h.in +++ b/xmlversion.h.in @@ -129,7 +129,7 @@ extern void xmlCheckVersion(int version); * * Whether iconv support is available */ -#ifndef WIN32 +#if !defined(WIN32) || defined(__CYGWIN__) #if @WITH_ICONV@ #define LIBXML_ICONV_ENABLED #else