From 84aa765a197eacbb8e09fc0af2e1e00937ae6178 Mon Sep 17 00:00:00 2001 From: Suman Manjunath Date: Tue, 13 Jan 2009 03:41:19 +0000 Subject: Patch from Felix Riemann ** Fix for bug #563867 (Unescape "&" when passing the link to browsers). svn path=/trunk/; revision=37063 --- mail/em-utils.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'mail/em-utils.c') diff --git a/mail/em-utils.c b/mail/em-utils.c index bb92d7ad03..f65edb0e40 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -2442,3 +2442,34 @@ em_utils_show_info_silent (GtkWidget *widget) g_signal_connect(widget, "response", G_CALLBACK(error_response), NULL); e_activity_handler_make_error (handler, "mail", E_LOG_WARNINGS, widget); } + +gchar * +em_utils_url_unescape_amp (const gchar *url) +{ + gchar *buff; + int i, j, amps; + + if (!url) + return NULL; + + amps = 0; + for (i = 0; url [i]; i++) { + if (url [i] == '&' && strncmp (url + i, "&", 5) == 0) + amps++; + } + + buff = g_strdup (url); + + if (!amps) + return buff; + + for (i = 0, j = 0; url [i]; i++, j++) { + buff [j] = url [i]; + + if (url [i] == '&' && strncmp (url + i, "&", 5) == 0) + i += 4; + } + buff [j] = 0; + + return buff; +} -- cgit