From: Carl Worth <cworth@cworth.org>
Date: Tue, 24 May 2011 17:52:38 +0000 (-0700)
Subject: notmuch reply: Avoid segmentation fault when printing multiple parts
X-Git-Tag: debian/0.6_254~125
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=b825bce61d24963f5b9c9c94d89e306640ac104b;p=notmuch

notmuch reply: Avoid segmentation fault when printing multiple parts

The code was previously trying to print a NULL string in this case, which
is obviously what we don't want to do.
---

diff --git a/show-message.c b/show-message.c
index 32bb860f..2ec9eca9 100644
--- a/show-message.c
+++ b/show-message.c
@@ -46,7 +46,7 @@ show_message_part (GMimeObject *part,
     selected = (params->part <= 0 || state->part_count == params->part);
 
     if (selected || state->in_zone) {
-	if (!first && (params->part <= 0 || state->in_zone))
+	if (!first && (params->part <= 0 || state->in_zone) && format->part_sep)
 	    fputs (format->part_sep, stdout);
 
 	format->part (part, &(state->part_count));