From e6e5c62426ca21578f39867589e5736421dc36a4 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 15 Dec 2010 18:37:47 +0100 Subject: Bug #250046 - Quote names in addresses when necessary in mail preview --- mail/em-format-html.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 6b74da70b5..f32124d321 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -2415,7 +2415,13 @@ efh_format_address (EMFormatHTML *efh, GString *out, struct _camel_header_addres if (name && *name) { gchar *real, *mailaddr; - g_string_append_printf (out, "%s <", name); + if (strchr (a->name, ',') || strchr (a->name, ';')) + g_string_append_printf (out, ""%s"", name); + else + g_string_append (out, name); + + g_string_append (out, " <"); + /* rfc2368 for mailto syntax and url encoding extras */ if ((real = camel_header_encode_phrase ((guchar *)a->name))) { mailaddr = g_strdup_printf("%s <%s>", real, a->v.addr); -- cgit v1.2.3