diff options
author | Leah Neukirchen <leah@vuxu.org> | 2018-02-07 11:30:31 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2018-02-07 11:30:31 +0100 |
commit | 6c6055b78b8b7340557c84636ea072b9d1ab4992 (patch) | |
tree | 7326cae9eb120ecd6ea1191c7e8d59245a27f547 | |
parent | 32144a2eaaa7a06be126b32ea79a15e204e8fba5 (diff) | |
download | mblaze-6c6055b78b8b7340557c84636ea072b9d1ab4992.tar.gz mblaze-6c6055b78b8b7340557c84636ea072b9d1ab4992.tar.xz mblaze-6c6055b78b8b7340557c84636ea072b9d1ab4992.zip |
mshow: render_mime: don't print any MIME structure markers with -N.
Reported by Larry Hynes.
-rw-r--r-- | mshow.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mshow.c b/mshow.c index 614b7d9..edb110b 100644 --- a/mshow.c +++ b/mshow.c @@ -210,7 +210,8 @@ render_mime(int depth, struct message *msg, char *body, size_t bodylen) char *charset = 0, *cs, *cse; if (blaze822_mime_parameter(ct, "charset", &cs, &cse)) { charset = strndup(cs, cse-cs); - printf(" charset=\"%s\"", charset); + if (!Nflag) + printf(" charset=\"%s\"", charset); setenv("PIPE_CHARSET", charset, 1); free(charset); } @@ -244,14 +245,16 @@ render_mime(int depth, struct message *msg, char *body, size_t bodylen) } else if (e >= 65 && e <= 80) { // choose N-64th part struct message *imsg = 0; int n = e - 64; - printf(" selector=\"%s\" part=%d ---\n", cmd, n); + if (!Nflag) + printf(" selector=\"%s\" part=%d ---\n", cmd, n); while (blaze822_multipart(msg, &imsg)) { if (--n == 0) blaze822_walk_mime(imsg, depth+1, render_mime); } blaze822_free(imsg); } else { - printf(" filter=\"%s\" FAILED status=%d", cmd, e); + if (!Nflag) + printf(" filter=\"%s\" FAILED status=%d", cmd, e); free(output); goto nofilter; } |