mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-08 13:39:58 +00:00
Fix detection of missing close tags at the end of a document (STR #45)
This commit is contained in:
parent
4636114c5b
commit
40a4dd5242
2
CHANGES
2
CHANGES
@ -5,6 +5,8 @@ CHANGES IN Mini-XML 2.3
|
||||
|
||||
- Added two exceptions to the LGPL to support static
|
||||
linking of applications against Mini-XML.
|
||||
- mxmlLoad*() did not detect missing close tags at the end
|
||||
of an XML document.
|
||||
- Added user_data and ref_count members to mxml_node_t
|
||||
structure.
|
||||
- Added mxmlReleaseNode() and mxmlRetainNode() APIs for
|
||||
|
@ -10,6 +10,9 @@
|
||||
<li>Added two exceptions to the LGPL to support static
|
||||
linking of applications against Mini-XML.</li>
|
||||
|
||||
<li>mxmlLoad*() did not detect missing close tags at the end
|
||||
of an XML document.</li>
|
||||
|
||||
<li>Added user_data and ref_count members to mxml_node_t
|
||||
structure.</li>
|
||||
|
||||
|
15
mxml-file.c
15
mxml-file.c
@ -1748,7 +1748,7 @@ mxml_load_data(mxml_node_t *top, /* I - Top node */
|
||||
*/
|
||||
|
||||
mxml_error("Mismatched close tag <%s> under parent <%s>!",
|
||||
buffer, parent ? parent->value.element.name : "(nil)");
|
||||
buffer, parent ? parent->value.element.name : "(null)");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -1856,8 +1856,21 @@ mxml_load_data(mxml_node_t *top, /* I - Top node */
|
||||
|
||||
if (parent)
|
||||
{
|
||||
node = parent;
|
||||
|
||||
while (parent->parent != top && parent->parent)
|
||||
parent = parent->parent;
|
||||
|
||||
if (node != parent)
|
||||
{
|
||||
mxml_error("Missing close tag </%s> under parent <%s>!",
|
||||
node->value.element.name,
|
||||
node->parent ? node->parent->value.element.name : "(null)");
|
||||
|
||||
mxmlDelete(first);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return (parent);
|
||||
|
Loading…
Reference in New Issue
Block a user