1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

Well the bugs I was chasing on XSLT were ... in libxml ... grrrr:

- xpath.c: ouch don't free NULL, rare case fixed
- tree.c: don't coalesce text nodes if they don't have the
  same behaviour wrt escaping on output
Daniel
This commit is contained in:
Daniel Veillard
2001-02-12 17:36:05 +00:00
parent d12b69ddf5
commit 5dd2f0a6cd
3 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,9 @@
Mon Feb 12 18:33:20 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* xpath.c: ouch don't free NULL, rare case fixed
* tree.c: don't coalesce text nodes if they don't have the
same behaviour wrt escaping on output
Sun Feb 11 21:15:41 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr> Sun Feb 11 21:15:41 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* xpath.c: small fixup * xpath.c: small fixup

10
tree.c
View File

@ -2074,7 +2074,8 @@ xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) {
* If cur and parent->last both are TEXT nodes, then merge them. * If cur and parent->last both are TEXT nodes, then merge them.
*/ */
if ((cur->type == XML_TEXT_NODE) && if ((cur->type == XML_TEXT_NODE) &&
(parent->last->type == XML_TEXT_NODE)) { (parent->last->type == XML_TEXT_NODE) &&
(cur->name == parent->last->name)) {
#ifndef XML_USE_BUFFER_CONTENT #ifndef XML_USE_BUFFER_CONTENT
xmlNodeAddContent(parent->last, cur->content); xmlNodeAddContent(parent->last, cur->content);
#else #else
@ -2163,7 +2164,8 @@ xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) {
xmlFreeNode(cur); xmlFreeNode(cur);
return(parent); return(parent);
} }
if ((parent->last != NULL) && (parent->last->type == XML_TEXT_NODE)) { if ((parent->last != NULL) && (parent->last->type == XML_TEXT_NODE) &&
(parent->last->name == cur->name)) {
#ifndef XML_USE_BUFFER_CONTENT #ifndef XML_USE_BUFFER_CONTENT
xmlNodeAddContent(parent->last, cur->content); xmlNodeAddContent(parent->last, cur->content);
#else #else
@ -3146,6 +3148,8 @@ xmlNodeGetBase(xmlDocPtr doc, xmlNodePtr cur) {
return(base); return(base);
cur = cur->parent; cur = cur->parent;
} }
if ((doc != NULL) && (doc->URL != NULL))
return(xmlStrdup(doc->URL));
return(NULL); return(NULL);
} }
@ -3522,6 +3526,8 @@ xmlTextMerge(xmlNodePtr first, xmlNodePtr second) {
if (second == NULL) return(first); if (second == NULL) return(first);
if (first->type != XML_TEXT_NODE) return(first); if (first->type != XML_TEXT_NODE) return(first);
if (second->type != XML_TEXT_NODE) return(first); if (second->type != XML_TEXT_NODE) return(first);
if (second->name != first->name)
return(first);
#ifndef XML_USE_BUFFER_CONTENT #ifndef XML_USE_BUFFER_CONTENT
xmlNodeAddContent(first, second->content); xmlNodeAddContent(first, second->content);
#else #else

View File

@ -1918,7 +1918,8 @@ xmlXPathEqualNodeSetString(xmlXPathObjectPtr arg, const xmlChar *str) {
xmlFree(str2); xmlFree(str2);
return(1); return(1);
} }
xmlFree(str2); if (str2 != NULL)
xmlFree(str2);
} }
return(0); return(0);
} }