diff options
Diffstat (limited to 'dev-libs/libxml2/files/libxml2-2.7.2-xmlAddChildList-pointer.patch')
-rw-r--r-- | dev-libs/libxml2/files/libxml2-2.7.2-xmlAddChildList-pointer.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/dev-libs/libxml2/files/libxml2-2.7.2-xmlAddChildList-pointer.patch b/dev-libs/libxml2/files/libxml2-2.7.2-xmlAddChildList-pointer.patch new file mode 100644 index 000000000000..a7f40d857b97 --- /dev/null +++ b/dev-libs/libxml2/files/libxml2-2.7.2-xmlAddChildList-pointer.patch @@ -0,0 +1,50 @@ +Upstream SVN trunk revision 3806 + +Wed Dec 31 23:11:37 CET 2008 Rob Richards + +* tree.c: set doc on last child tree in xmlAddChildList for + bug #546772. Fix problem adding an attribute via with xmlAddChild + reported by Kris Breuker. + +diff --git a/tree.c b/tree.c +index fe89dc4..8e393da 100644 +--- a/tree.c ++++ b/tree.c +@@ -3216,7 +3216,10 @@ xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) { + cur = cur->next; + } + cur->parent = parent; +- cur->doc = parent->doc; /* the parent may not be linked to a doc ! */ ++ /* the parent may not be linked to a doc ! */ ++ if (cur->doc != parent->doc) { ++ xmlSetTreeDoc(cur, parent->doc); ++ } + parent->last = cur; + + return(cur); +@@ -3309,9 +3312,7 @@ xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { + if (cur->type == XML_ATTRIBUTE_NODE) { + if (parent->type != XML_ELEMENT_NODE) + return(NULL); +- if (parent->properties == NULL) { +- parent->properties = (xmlAttrPtr) cur; +- } else { ++ if (parent->properties != NULL) { + /* check if an attribute with the same name exists */ + xmlAttrPtr lastattr; + +@@ -3326,8 +3327,13 @@ xmlAddChild(xmlNodePtr parent, xmlNodePtr cur) { + } + if (lastattr == (xmlAttrPtr) cur) + return(cur); ++ ++ } ++ if (parent->properties == NULL) { ++ parent->properties = (xmlAttrPtr) cur; ++ } else { + /* find the end */ +- lastattr = parent->properties; ++ xmlAttrPtr lastattr = parent->properties; + while (lastattr->next != NULL) { + lastattr = lastattr->next; + } |