aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-show.c
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2011-05-31 16:18:45 -0700
committerGravatar Carl Worth <cworth@cworth.org>2011-05-31 16:18:45 -0700
commit2d1356e8dbfbf0361233b38e4fac030b86c4e03e (patch)
tree810d1a8b8346714035275c402527b49e7ccace94 /notmuch-show.c
parentf744b050b16d2a8c7223e06f7e071914ae05645e (diff)
Reduce some excessive indentation.
I prefer checking a condition and returning early rather than making large blocks of code within a function conditional.
Diffstat (limited to 'notmuch-show.c')
-rw-r--r--notmuch-show.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/notmuch-show.c b/notmuch-show.c
index 1ed49d99..b9a41cc6 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -393,22 +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));
- charset = g_mime_object_get_content_type_parameter (part, "charset");
+ if (stream_out == NULL)
+ return;
- 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);
- }
+ 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));
+
+ 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));