From ca03bb19722cff4266cebd4339c6aeb120a3f017 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 20 Jan 2016 17:33:23 +0100 Subject: [PATCH] Fixed issue with ampersand in config dump --- coreapi/lpc2xml.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coreapi/lpc2xml.c b/coreapi/lpc2xml.c index ed63669d0..edef1f764 100644 --- a/coreapi/lpc2xml.c +++ b/coreapi/lpc2xml.c @@ -100,7 +100,9 @@ static int processEntry(const char *section, const char *entry, xmlNode *node, l } lpc2xml_log(ctx, LPC2XML_MESSAGE, "Set %s|%s = %s", section, entry, content); - xmlNodeSetContent(node, (const xmlChar *) content); + // xmlNodeSetContent expects special characters to be escaped, xmlNodeAddContent doesn't (and escapes what needs to be) + xmlNodeSetContent(node, (const xmlChar *) ""); + xmlNodeAddContent(node, (const xmlChar *) content); if (lp_config_get_overwrite_flag_for_entry(ctx->lpc, section, entry) || lp_config_get_overwrite_flag_for_section(ctx->lpc, section)) { xmlSetProp(node, (const xmlChar *)"overwrite", (const xmlChar *) "true");