aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-quote.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-format-quote.c')
-rw-r--r--mail/em-format-quote.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/mail/em-format-quote.c b/mail/em-format-quote.c
index e25b182a31..dc5695cfc2 100644
--- a/mail/em-format-quote.c
+++ b/mail/em-format-quote.c
@@ -209,14 +209,17 @@ emfq_format_address (GString *out, struct _camel_header_address *a)
case CAMEL_HEADER_ADDRESS_NAME:
if (name && *name) {
char *real, *mailaddr;
-
+
g_string_append_printf (out, "%s <", name);
/* rfc2368 for mailto syntax and url encoding extras */
- real = camel_header_encode_phrase (a->name);
- mailaddr = g_strdup_printf ("%s <%s>", real, a->v.addr);
- g_free (real);
- mailto = camel_url_encode (mailaddr, "?=&()");
- g_free (mailaddr);
+ if ((real = camel_header_encode_phrase (a->name))) {
+ mailaddr = g_strdup_printf ("%s <%s>", real, a->v.addr);
+ g_free (real);
+ mailto = camel_url_encode (mailaddr, "?=&()");
+ g_free (mailaddr);
+ } else {
+ mailto = camel_url_encode (a->v.addr, "?=&()");
+ }
} else {
mailto = camel_url_encode (a->v.addr, "?=&()");
}