From 4edca0ec3a461052260347ec5f2bcfbe4bd6e318 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 20 Aug 2017 17:00:14 +0200 Subject: mshow: use return value 62 for raw output of filters E.g. for elinks -dump -dump-color-mode 3 --- mshow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mshow.c b/mshow.c index 768f412..66ccb97 100644 --- 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'); } -- cgit 1.4.1