From e2c243bc26fb7f98935a0c1e15463982c87d588f Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Tue, 9 Jan 2018 17:01:35 +0100 Subject: [PATCH] mshow: exit with status 1 if -R didn't find a plain text reply --- mshow.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mshow.c b/mshow.c index 98c309e..1a98801 100644 --- a/mshow.c +++ b/mshow.c @@ -36,6 +36,8 @@ struct message *filters; static int mimecount; static int safe_output; +static int reply_found; + static char defaultAflags[] = "text/plain:text/html"; static char *Aflag = defaultAflags; @@ -356,6 +358,7 @@ reply_mime(int depth, struct message *msg, char *body, size_t bodylen) print_ascii(body, bodylen); else print_u8recode(body, bodylen, charset); + reply_found++; free(charset); } @@ -404,7 +407,10 @@ reply(char *file) struct message *msg = blaze822_file(file); if (!msg) return; + reply_found = 0; blaze822_walk_mime(msg, 0, reply_mime); + if (!reply_found) + exit(1); } static int extract_argc;