mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Fix reading of CDATA elements
If the element we are parsing is of type XML_CDATA_SECTION_NODE, we have to check the node's name from the parent. Fixes #718 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ee7c86f206
commit
70d4b25146
1 changed files with 3 additions and 2 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue