summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2007-09-14 20:28:52 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2007-09-14 20:28:52 +0100
commitc3cef78f9f432b5a6032ce7f0022d9a0a139e2fd (patch)
tree18d8658a1073c5be6392fac1818e3b93f266c434
parentadbc58dcc507fbca0acaa9aa7251965264cadf87 (diff)
downloadxine-lib-c3cef78f9f432b5a6032ce7f0022d9a0a139e2fd.tar.gz
xine-lib-c3cef78f9f432b5a6032ce7f0022d9a0a139e2fd.tar.bz2
Given <a>b<c/>d</a>, append rather than replace text - "bd", not "d".
-rw-r--r--src/xine-utils/xmlparser.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c
index a63ac39d6..a9fa940db 100644
--- a/src/xine-utils/xmlparser.c
+++ b/src/xine-utils/xmlparser.c
@@ -22,6 +22,10 @@
*
*/
+#ifdef XINE_COMPILE
+# include "config.h"
+#endif
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -226,10 +230,15 @@ static int xml_parser_get_node_internal (xml_node_t *current_node, char *root_na
case (T_DATA):
/* current data */
if (current_node->data) {
- /* avoid a memory leak */
- free(current_node->data);
+ /* Append to existing text. FIXME - should use a child node */
+ char *data, *decoded = lexer_decode_entities (tok);
+ asprintf (&data, "%s%s", current_node->data, decoded);
+ free (decoded);
+ free (current_node->data);
+ current_node->data = data;
}
- current_node->data = lexer_decode_entities(tok);
+ else
+ current_node->data = lexer_decode_entities (tok);
lprintf("info: node data : %s\n", current_node->data);
break;
default: