From: Sebastian Spaeth <Sebastian@SSpaeth.de>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/2] notmuch-show: Do not output (null) when the message body is empty
Date: Tue, 2 Mar 2010 11:52:32 +0100 [thread overview]
Message-ID: <1267527153-8364-1-git-send-email-Sebastian@SSpaeth.de> (raw)
In-Reply-To: <87k4twc5dh.fsf@servo.finestructure.net>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
---
I actually agree that we should output tags as array, it was just that the get_tags_as_string function was already existing, so that was more convenient. Here comes the second iteration that outputs the tags as json array.
notmuch-show.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/notmuch-show.c b/notmuch-show.c
index 1a1d601..f21914f 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -311,8 +311,10 @@ format_part_json (GMimeObject *part, int *part_count)
{
show_part_content (part, stream_memory);
part_content = g_mime_stream_mem_get_byte_array (GMIME_STREAM_MEM (stream_memory));
-
- printf (", \"content\": %s", json_quote_str (ctx, (char *) part_content->data));
+ if (part_content->data != NULL)
+ printf (", \"content\": %s", json_quote_str (ctx, (char *) part_content->data));
+ else
+ printf (", \"content\": \"\"");
}
fputs ("}", stdout);
--
1.6.3.3
next prev parent reply other threads:[~2010-03-02 10:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <id:1262249616-sup-3911@elise>
2009-12-31 15:17 ` [PATCH] Add an "--format=(json|text)" command-line option to both notmuch-search and notmuch-show david
2009-12-31 20:27 ` Scott Robinson
2010-02-10 13:51 ` David Bremner
2010-02-10 17:54 ` Scott Robinson
2010-02-23 20:56 ` Carl Worth
2010-03-01 14:58 ` [Sebastian Spaeth] " Sebastian Spaeth
2010-03-01 15:39 ` [PATCH] notmuch-show: add tags to json output Sebastian Spaeth
2010-03-01 17:26 ` David Bremner
2010-03-01 17:35 ` Jameson Rollins
2010-03-02 10:52 ` Sebastian Spaeth [this message]
2010-03-02 10:52 ` [PATCH 2/2] " Sebastian Spaeth
2010-03-10 9:41 ` Sebastian Spaeth
2010-03-11 12:11 ` [PATCH] " Sebastian Spaeth
2010-03-11 12:34 ` Carl Worth
2010-03-01 15:59 ` more json woes Sebastian Spaeth
2010-03-01 16:12 ` [PATCH] notmuch-show: Do not output (null) when the message body is empty Sebastian Spaeth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267527153-8364-1-git-send-email-Sebastian@SSpaeth.de \
--to=sebastian@sspaeth.de \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).