diff options
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r-- | mail/em-utils.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c index e31bab0d22..8dbadea15b 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -2473,3 +2473,34 @@ em_utils_show_info_silent (GtkWidget *widget) widget, "response", G_CALLBACK (gtk_widget_destroy), NULL); } + +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; +} |