X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-show.c;h=b9a41cc653e4bab6f277e85d7d9d173a33711b7f;hp=df601fbb4af3fe61f69cb7d6364297bc188022e1;hb=2d1356e8dbfbf0361233b38e4fac030b86c4e03e;hpb=10a48e0566db1566e6c0221b9f9927ac123a0c1f diff --git a/notmuch-show.c b/notmuch-show.c index df601fbb..b9a41cc6 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -393,26 +393,23 @@ show_text_part_content (GMimeObject *part, GMimeStream *stream_out) INTERNAL_ERROR ("Illegal request to format non-text part (%s) as text.", g_mime_content_type_to_string (content_type)); - /* do nothing if this is a multipart */ - if (GMIME_IS_MULTIPART (part) || GMIME_IS_MESSAGE_PART (part)) + if (stream_out == NULL) return; - charset = g_mime_object_get_content_type_parameter (part, "charset"); + stream_filter = g_mime_stream_filter_new (stream_out); + g_mime_stream_filter_add(GMIME_STREAM_FILTER (stream_filter), + g_mime_filter_crlf_new (FALSE, FALSE)); - if (stream_out) { - stream_filter = g_mime_stream_filter_new (stream_out); - g_mime_stream_filter_add(GMIME_STREAM_FILTER (stream_filter), - g_mime_filter_crlf_new (FALSE, FALSE)); - if (charset) { - GMimeFilter *charset_filter; - charset_filter = g_mime_filter_charset_new (charset, "UTF-8"); - /* This result can be NULL for things like "unknown-8bit". - * Don't set a NULL filter as that makes GMime print - * annoying assertion-failure messages on stderr. */ - if (charset_filter) - g_mime_stream_filter_add (GMIME_STREAM_FILTER (stream_filter), - charset_filter); - } + charset = g_mime_object_get_content_type_parameter (part, "charset"); + if (charset) { + GMimeFilter *charset_filter; + charset_filter = g_mime_filter_charset_new (charset, "UTF-8"); + /* This result can be NULL for things like "unknown-8bit". + * Don't set a NULL filter as that makes GMime print + * annoying assertion-failure messages on stderr. */ + if (charset_filter) + g_mime_stream_filter_add (GMIME_STREAM_FILTER (stream_filter), + charset_filter); } wrapper = g_mime_part_get_content_object (GMIME_PART (part));