mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 4edca0ec3a461052260347ec5f2bcfbe4bd6e318
parent 6718576b9fbffc5b17204dce4214b8a27fd6d500
Author: Leah Neukirchen <leah@vuxu.org>
Date:   Sun, 20 Aug 2017 17:00:14 +0200

mshow: use return value 62 for raw output of filters

E.g. for elinks -dump -dump-color-mode 3

Diffstat:
mshow.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/mshow.c b/mshow.c @@ -217,11 +217,14 @@ render_mime(int depth, struct message *msg, char *body, size_t bodylen) size_t outlen; int e = filter(body, bodylen, cmd, &output, &outlen); - if (e == 0) { // replace output + if (e == 0 || e == 62) { // replace output (62 == raw) if (!Nflag) printf(" render=\"%s\" ---\n", cmd); if (outlen) { - print_ascii(output, outlen); + if (e == 0) + print_ascii(output, outlen); + else + return fwrite(output, 1, outlen, stdout); if (output[outlen-1] != '\n') putchar('\n'); }