diff options
author | Milan Crha <mcrha@redhat.com> | 2009-11-06 04:01:18 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-11-06 04:01:18 +0800 |
commit | f2e75c5d13a0899b042e7c7f60639be19871f7ca (patch) | |
tree | a272e05ba525a1ef777c4ee0d03c35e716de8474 /mail/mail-ops.c | |
parent | 4fd8fbc29a32a2d91b75599f24f49f66002ddb8f (diff) | |
download | gsoc2013-evolution-f2e75c5d13a0899b042e7c7f60639be19871f7ca.tar gsoc2013-evolution-f2e75c5d13a0899b042e7c7f60639be19871f7ca.tar.gz gsoc2013-evolution-f2e75c5d13a0899b042e7c7f60639be19871f7ca.tar.bz2 gsoc2013-evolution-f2e75c5d13a0899b042e7c7f60639be19871f7ca.tar.lz gsoc2013-evolution-f2e75c5d13a0899b042e7c7f60639be19871f7ca.tar.xz gsoc2013-evolution-f2e75c5d13a0899b042e7c7f60639be19871f7ca.tar.zst gsoc2013-evolution-f2e75c5d13a0899b042e7c7f60639be19871f7ca.zip |
Bug #598877 - Crash while sending mail, in report_status function
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 2de8f6de38..8110ab48db 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -429,6 +429,28 @@ mail_fetch_mail (const gchar *source, gint keep, const gchar *type, CamelOperati mail_msg_unordered_push (m); } +static gchar * +escape_percent_sign (const gchar *str) +{ + GString *res; + + if (!str) + return NULL; + + res = g_string_sized_new (strlen (str)); + while (*str) { + if (*str == '%') { + g_string_append (res, "%%"); + } else { + g_string_append_c (res, *str); + } + + str++; + } + + return g_string_free (res, FALSE); +} + /* ********************************************************************** */ /* sending stuff */ /* ** SEND MAIL *********************************************************** */ @@ -502,8 +524,14 @@ mail_send_message (struct _send_queue_msg *m, CamelFolder *queue, const gchar *u sent_folder_uri = g_strstrip(g_strdup(tmp)); } - /* let the dialog know the right account it is using; percentage is ignored */ - report_status (m, CAMEL_FILTER_STATUS_ACTION, 0, transport_url ? transport_url : destination); + if (transport_url || destination) { + gchar *escaped = escape_percent_sign (transport_url ? transport_url : destination); + + /* let the dialog know the right account it is using; percentage is ignored */ + report_status (m, CAMEL_FILTER_STATUS_ACTION, 0, escaped); + + g_free (escaped); + } /* Check for email sending */ from = (CamelAddress *) camel_internet_address_new (); |