mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +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; | 	int levels = 2; | ||||||
| 	char *p = buf; | 	char *p = buf; | ||||||
| 
 | 
 | ||||||
| 	if (!node || !node->name) | 	if (node->type != XML_CDATA_SECTION_NODE && (!node || !node->name)) { | ||||||
| 		return "root"; | 		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; | 		node = node->parent; | ||||||
| 
 | 
 | ||||||
| 	/* Make sure it's always NUL-terminated */ | 	/* Make sure it's always NUL-terminated */ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue