aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-08-20 17:00:14 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-08-20 17:00:14 +0200
commit4edca0ec3a461052260347ec5f2bcfbe4bd6e318 (patch)
treef03d5de9ad92852e247c087b1f18595abb175474
parent6718576b9fbffc5b17204dce4214b8a27fd6d500 (diff)
downloadmblaze-4edca0ec3a461052260347ec5f2bcfbe4bd6e318.tar.gz
mshow: use return value 62 for raw output of filters
E.g. for elinks -dump -dump-color-mode 3
-rw-r--r--mshow.c7
1 files 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');
}