summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parse-xml.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 63ce64f86..fb5533708 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -1526,10 +1526,11 @@ static const char *nodename(xmlNode *node, char *buf, int len)
int levels = 2;
char *p = buf;
- if (!node || !node->name)
+ if (node->type != XML_CDATA_SECTION_NODE && (!node || !node->name)) {
return "root";
+ }
- if (node->parent && !strcmp(node->name, "text"))
+ if (node->type == XML_CDATA_SECTION_NODE || (node->parent && !strcmp(node->name, "text")))
node = node->parent;
/* Make sure it's always NUL-terminated */