projects
/
ardour.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eca27d8
)
Fix XML-writer edge-case (empty content)
author
Robin Gareus
<robin@gareus.org>
Fri, 1 Nov 2019 14:39:44 +0000
(15:39 +0100)
committer
Robin Gareus
<robin@gareus.org>
Fri, 1 Nov 2019 14:39:44 +0000
(15:39 +0100)
libs/pbd/xml++.cc
patch
|
blob
|
history
diff --git
a/libs/pbd/xml++.cc
b/libs/pbd/xml++.cc
index 65488529174a1121a442418041dc0551930b7e83..95fb370b04e32a51acb17baa4189450ee4b4ae9f 100644
(file)
--- a/
libs/pbd/xml++.cc
+++ b/
libs/pbd/xml++.cc
@@
-482,6
+482,12
@@
XMLNode::attribute_value()
XMLNode*
XMLNode::add_content(const string& c)
{
+ if (c.empty ()) {
+ /* this would add a "</>" child, leading to invalid XML.
+ * Also in XML, empty string content is equivalent to no content.
+ */
+ return NULL;
+ }
return add_child_copy(XMLNode (string(), c));
}