Do not write siblings of the passed node (Issue #228)

pull/244/head
Michael R Sweet 6 years ago
parent d32a541211
commit f86c2671aa
No known key found for this signature in database
GPG Key ID: 999559A027815955
  1. 2
      CHANGES.md
  2. 2
      doc/mxml.man
  3. 18
      mxml-file.c

@ -9,6 +9,8 @@
trailer "]]" to the string (Issue #216)
- Cross-compiling failed on install (Issue #218)
- Fixed a crash bug in the `mxmlWrite` functions (Issue #228)
- The `mxmlWrite` functions no longer write the siblings of the passed node
(Issue #228)
- Updated the markdown and ZIP container libraries used for mxmldoc.

@ -1,4 +1,4 @@
.TH mxml 3 "Mini-XML API" "09/29/18" "Mini-XML API"
.TH mxml 3 "Mini-XML API" "10/01/18" "Mini-XML API"
.SH NAME
mxml \- Mini-XML API
.SH INCLUDE FILE

@ -2972,6 +2972,20 @@ mxml_write_node(mxml_node_t *node, /* I - Node to write */
if ((next = current->child) == NULL)
{
if (current == node)
{
/*
* Don't traverse to sibling node if we are at the "root" node...
*/
next = NULL;
}
else
{
/*
* Try the next sibling, and continue traversing upwards as needed...
*/
while ((next = current->next) == NULL)
{
if (current == node || !current->parent)
@ -3001,6 +3015,10 @@ mxml_write_node(mxml_node_t *node, /* I - Node to write */
col = mxml_write_ws(current, p, cb, MXML_WS_AFTER_CLOSE, col, putc_cb);
}
if (current == node)
break;
}
}
}
}

Loading…
Cancel
Save