Permalink
Browse files

Merge pull request #715 from gao-yan/patchset-v1-delete-attribute

Fix: xml: Correctly create v1 patchsets when deleting attributes
  • Loading branch information...
beekhof committed May 18, 2015
2 parents 0b79da3 + a2148b9 commit 2135206088d8b149e62dc61490e608a145106f18
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/common/xml.c
View
@@ -4548,6 +4548,8 @@ subtract_xml_object(xmlNode * parent, xmlNode * left, xmlNode * right,
/* changes to name/value pairs */
for (xIter = crm_first_attr(left); xIter != NULL; xIter = xIter->next) {
const char *prop_name = (const char *)xIter->name;
xmlAttrPtr right_attr = NULL;
xml_private_t *p = NULL;
if (strcmp(prop_name, XML_ATTR_ID) == 0) {
continue;
@@ -4566,8 +4568,13 @@ subtract_xml_object(xmlNode * parent, xmlNode * left, xmlNode * right,
continue;
}
right_attr = xmlHasProp(right, (const xmlChar *)prop_name);
if (right_attr) {
p = right_attr->_private;
}
right_val = crm_element_value(right, prop_name);
if (right_val == NULL) {
if (right_val == NULL || (p && is_set(p->flags, xpf_deleted))) {
/* new */
*changed = TRUE;
if (full) {

0 comments on commit 2135206

Please sign in to comment.