X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-tny-mime-part.c;h=ff6c1cdf90909adbca32e7e6f6a1a572463e29df;hp=bd66d0244ea8ac42e3b73e0018cba121dda8b8af;hb=3f40a05130d6c83d8589b681ea8460050dba73e8;hpb=4de051a995260caf9f4c46dbd8cc3b2340eab5a4 diff --git a/src/modest-tny-mime-part.c b/src/modest-tny-mime-part.c index bd66d02..ff6c1cd 100644 --- a/src/modest-tny-mime-part.c +++ b/src/modest-tny-mime-part.c @@ -211,25 +211,24 @@ gchar * modest_tny_mime_part_get_headers_content_type (TnyMimePart *part) { gchar *header_content_type; - gchar *header_content_type_lower; gchar *suffix; g_return_val_if_fail (TNY_IS_MIME_PART (part), NULL); header_content_type = modest_tny_mime_part_get_header_value (part, "Content-Type"); + /* See RFC2045 sec 5.2 */ if (!header_content_type) - return NULL; + return g_strdup ("text/plain; charset=us-ascii"); header_content_type = g_strstrip (header_content_type); /* remove the ; suffix */ suffix = index (header_content_type, ';'); - suffix[0] = '\0'; + if (suffix) + suffix[0] = '\0'; - header_content_type_lower = (header_content_type ) ? - g_ascii_strdown (header_content_type, -1) : NULL; - return header_content_type_lower; + return g_ascii_strdown (header_content_type, -1); } gchar *