Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 7f / 420d225d48a33deb2f4609536479bfcc3c1f64
1 Return-Path: <Sebastian@SSpaeth.de>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id DBC45431FC3\r
6         for <notmuch@notmuchmail.org>; Mon,  1 Mar 2010 08:12:26 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.162\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.162 tagged_above=-999 required=5\r
12         tests=[AWL=-0.052, BAYES_05=-1.11] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id ZqiNiytRWRiK for <notmuch@notmuchmail.org>;\r
16         Mon,  1 Mar 2010 08:12:26 -0800 (PST)\r
17 Received: from homiemail-a12.g.dreamhost.com (caiajhbdccah.dreamhost.com\r
18         [208.97.132.207])\r
19         by olra.theworths.org (Postfix) with ESMTP id 4F970431FBD\r
20         for <notmuch@notmuchmail.org>; Mon,  1 Mar 2010 08:12:26 -0800 (PST)\r
21 Received: from localhost.localdomain (mtec-hg-docking-1-dhcp-204.ethz.ch\r
22         [129.132.133.204])\r
23         by homiemail-a12.g.dreamhost.com (Postfix) with ESMTPA id B0DE3714060; \r
24         Mon,  1 Mar 2010 08:12:17 -0800 (PST)\r
25 From: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
26 To: notmuch@notmuchmail.org\r
27 Date: Mon,  1 Mar 2010 17:12:14 +0100\r
28 Message-Id: <1267459934-31815-1-git-send-email-Sebastian@SSpaeth.de>\r
29 X-Mailer: git-send-email 1.6.3.3\r
30 In-Reply-To: <87tyt0owwv.fsf@SSpaeth.de>\r
31 References: <87tyt0owwv.fsf@SSpaeth.de>\r
32 Subject: [notmuch] [PATCH] notmuch-show: Do not output (null) when the\r
33         message body is empty\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.13\r
36 Precedence: list\r
37 List-Id: "Use and development of the notmuch mail system."\r
38         <notmuch.notmuchmail.org>\r
39 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
42 List-Post: <mailto:notmuch@notmuchmail.org>\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
44 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
46 X-List-Received-Date: Mon, 01 Mar 2010 16:12:27 -0000\r
47 \r
48 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
49 ---\r
50  notmuch-show.c |    8 +++++---\r
51  1 files changed, 5 insertions(+), 3 deletions(-)\r
52 \r
53 diff --git a/notmuch-show.c b/notmuch-show.c\r
54 index 0f10797..4c794c4 100644\r
55 --- a/notmuch-show.c\r
56 +++ b/notmuch-show.c\r
57 @@ -310,10 +310,12 @@ format_part_json (GMimeObject *part, int *part_count)\r
58      if (g_mime_content_type_is_type (content_type, "text", "*") &&\r
59         !g_mime_content_type_is_type (content_type, "text", "html"))\r
60      {\r
61 -       show_part_content (part, stream_memory);\r
62 +        show_part_content (part, stream_memory);\r
63         part_content = g_mime_stream_mem_get_byte_array (GMIME_STREAM_MEM (stream_memory));\r
64 -\r
65 -       printf (", \"content\": %s", json_quote_str (ctx, (char *) part_content->data));\r
66 +       if (part_content->data != NULL)\r
67 +         printf (", \"content\": %s", json_quote_str (ctx, (char *) part_content->data));\r
68 +       else\r
69 +         printf (", \"content\": \"\"");\r
70      }\r
71  \r
72      fputs ("}", stdout);\r
73 -- \r
74 1.6.3.3\r
75 \r