aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-show.c
diff options
context:
space:
mode:
Diffstat (limited to 'notmuch-show.c')
-rw-r--r--notmuch-show.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/notmuch-show.c b/notmuch-show.c
index 006ccf9e..412f908d 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -30,8 +30,7 @@ format_headers_text (const void *ctx,
static void
format_part_text (GMimeObject *part,
- int *part_count,
- int first);
+ int *part_count);
static void
format_part_end_text (GMimeObject *part);
@@ -40,7 +39,7 @@ static const notmuch_show_format_t format_text = {
"",
"\fmessage{ ", format_message_text,
"\fheader{\n", format_headers_text, "\fheader}\n",
- "\fbody{\n", format_part_text, format_part_end_text, "\fbody}\n",
+ "\fbody{\n", format_part_text, format_part_end_text, "", "\fbody}\n",
"\fmessage}\n", "",
""
};
@@ -55,8 +54,7 @@ format_headers_json (const void *ctx,
static void
format_part_json (GMimeObject *part,
- int *part_count,
- int first);
+ int *part_count);
static void
format_part_end_json (GMimeObject *part);
@@ -65,7 +63,7 @@ static const notmuch_show_format_t format_json = {
"[",
"{", format_message_json,
", \"headers\": {", format_headers_json, "}",
- ", \"body\": [", format_part_json, format_part_end_json, "]",
+ ", \"body\": [", format_part_json, format_part_end_json, ", ", "]",
"}", ", ",
"]"
};
@@ -79,7 +77,7 @@ static const notmuch_show_format_t format_mbox = {
"",
"", format_message_mbox,
"", NULL, "",
- "", NULL, NULL, "",
+ "", NULL, NULL, "", "",
"", "",
""
};
@@ -357,7 +355,7 @@ show_part_content (GMimeObject *part, GMimeStream *stream_out)
}
static void
-format_part_text (GMimeObject *part, int *part_count, unused (int first))
+format_part_text (GMimeObject *part, int *part_count)
{
GMimeContentDisposition *disposition;
GMimeContentType *content_type;
@@ -431,7 +429,7 @@ format_part_end_text (GMimeObject *part)
}
static void
-format_part_json (GMimeObject *part, int *part_count, int first)
+format_part_json (GMimeObject *part, int *part_count)
{
GMimeContentType *content_type;
GMimeContentDisposition *disposition;
@@ -442,9 +440,6 @@ format_part_json (GMimeObject *part, int *part_count, int first)
content_type = g_mime_object_get_content_type (GMIME_OBJECT (part));
- if (! first)
- fputs (", ", stdout);
-
printf ("{\"id\": %d, \"content-type\": %s",
*part_count,
json_quote_str (ctx, g_mime_content_type_to_string (content_type)));