aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index f372240347..d37b4c2fae 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -199,7 +199,7 @@ process_header(CamelMedium *medium, const char *header_name, const char *header_
case HEADER_DESCRIPTION: /* raw header->utf8 conversion */
text = header_decode_string(header_value);
g_free(mime_part->description);
- mime_part->description = text;
+ mime_part->description = g_strstrip (text);
break;
case HEADER_DISPOSITION:
set_disposition (mime_part, header_value);
@@ -351,9 +351,13 @@ camel_mime_part_set_filename (CamelMimePart *mime_part, const gchar *filename)
const gchar *
camel_mime_part_get_filename (CamelMimePart *mime_part)
{
- if (mime_part->disposition)
- return header_param(mime_part->disposition->params, "filename");
- return NULL;
+ if (mime_part->disposition) {
+ const gchar *name = header_param (mime_part->disposition->params, "filename");
+ if (name)
+ return name;
+ }
+
+ return gmime_content_field_get_parameter (mime_part->content_type, "name");
}