aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-format.c')
-rw-r--r--mail/em-format.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mail/em-format.c b/mail/em-format.c
index 4c887dfd44..eaa0d77185 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -1148,7 +1148,7 @@ char *
em_format_describe_part(CamelMimePart *part, const char *mime_type)
{
GString *stext;
- const char *text;
+ const char *filename, *description;
char *out, *desc;
stext = g_string_new("");
@@ -1156,10 +1156,11 @@ em_format_describe_part(CamelMimePart *part, const char *mime_type)
desc = g_content_type_get_description (mime_type);
g_string_append_printf (stext, _("%s attachment"), desc ? desc : mime_type);
g_free (desc);
- if ((text = camel_mime_part_get_filename (part)))
- g_string_append_printf(stext, " (%s)", text);
- if ((text = camel_mime_part_get_description(part)))
- g_string_append_printf(stext, ", \"%s\"", text);
+ if ((filename = camel_mime_part_get_filename (part)))
+ g_string_append_printf(stext, " (%s)", filename);
+ if ((description = camel_mime_part_get_description(part)) &&
+ !(filename && (strcmp(filename, description) == 0)))
+ g_string_append_printf(stext, ", \"%s\"", description);
out = stext->str;
g_string_free(stext, FALSE);