Skip to content

Commit

Permalink
Don't add ]] to the CDATA node (Issue #216)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Jul 2, 2018
1 parent f2b282e commit e0db328
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

- No longer build documentation sets on macOS since Xcode no longer supports
them (Issue #198)
- Updated ZIP container library used for mxmldoc.
- The `mxmlNewCDATA` and `mxmlSetCDATA` functions incorrectly added the XML
trailer "]]" to the string (Issue #216)
- Updated the ZIP container library used for mxmldoc.


# Changes in Mini-XML 2.11
Expand Down
4 changes: 2 additions & 2 deletions mxml-node.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Node support code for Mini-XML, a small XML file parsing library.
*
* Copyright 2003-2017 by Michael R Sweet.
* Copyright 2003-2018 by Michael R Sweet.
*
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
Expand Down Expand Up @@ -306,7 +306,7 @@ mxmlNewCDATA(mxml_node_t *parent, /* I - Parent node or @code MXML_NO_PARENT@ */
*/

if ((node = mxml_new(parent, MXML_ELEMENT)) != NULL)
node->value.element.name = _mxml_strdupf("![CDATA[%s]]", data);
node->value.element.name = _mxml_strdupf("![CDATA[%s", data);

return (node);
}
Expand Down
4 changes: 2 additions & 2 deletions mxml-set.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Node set functions for Mini-XML, a small XML file parsing library.
*
* Copyright 2003-2017 by Michael R Sweet.
* Copyright 2003-2018 by Michael R Sweet.
*
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
Expand Down Expand Up @@ -53,7 +53,7 @@ mxmlSetCDATA(mxml_node_t *node, /* I - Node to set */
if (node->value.element.name)
free(node->value.element.name);

node->value.element.name = _mxml_strdupf("![CDATA[%s]]", data);
node->value.element.name = _mxml_strdupf("![CDATA[%s", data);

return (0);
}
Expand Down

0 comments on commit e0db328

Please sign in to comment.