From 748bb2c2b6e607c808e462d8bd14004cc10a28e5 Mon Sep 17 00:00:00 2001 From: Don Scorgie Date: Tue, 30 May 2006 17:52:14 +0000 Subject: Escape & characters when encountered in info processing (fixes #343372) * src/yelp-toc-pager.c: Escape & characters when encountered in info processing (fixes #343372) --- ChangeLog | 5 +++++ src/yelp-toc-pager.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22d4970f..8d262b98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-30 Don Scorgie + + * src/yelp-toc-pager.c: + Escape & characters when encountered in info processing (fixes #343372) + 2006-05-29 Brent Smith * src/yelp-toc-pager.c: (process_mandir_pending): diff --git a/src/yelp-toc-pager.c b/src/yelp-toc-pager.c index c9c91e42..6ecd71ce 100644 --- a/src/yelp-toc-pager.c +++ b/src/yelp-toc-pager.c @@ -1424,7 +1424,8 @@ process_info_pending (YelpTocPager *pager) xmlNodePtr tmp; xmlNodePtr new_node = NULL; gboolean menufound = FALSE; - + gchar ** amp; + if (!priv->toc_doc) { xmlXPathContextPtr xpath; xmlXPathObjectPtr obj; @@ -1444,7 +1445,14 @@ process_info_pending (YelpTocPager *pager) g_io_channel_read_to_end (channel, &str, &len, NULL); g_io_channel_shutdown (channel, FALSE, NULL); g_io_channel_unref (channel); - + /* Check the string for the special character '&' which + * screws up the xml. If its there, it needs escaping + */ + amp = g_strsplit (str, "&", -1); + g_free (str); + str = g_strjoinv ("&", amp); + g_strfreev (amp); + files = g_strsplit (str, "\n", -1); for (ptr = files; *ptr != NULL; ptr++) { -- cgit v1.2.1