about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-06 20:10:33 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-06 20:10:33 +0200
commit7377f0dfc3a262e3110a046eafa1d61cbbd32bc7 (patch)
tree067d2c5e2713a607252de3f01e00a7db8e7c826c
parent2776c838fe43e56260f44f63b12536bd41787d8c (diff)
downloadmblaze-7377f0dfc3a262e3110a046eafa1d61cbbd32bc7.tar.gz
mblaze-7377f0dfc3a262e3110a046eafa1d61cbbd32bc7.tar.xz
mblaze-7377f0dfc3a262e3110a046eafa1d61cbbd32bc7.zip
mshow: rather, use -r -O to print the part raw
-rw-r--r--man/mshow.16
-rw-r--r--mshow.c16
2 files changed, 16 insertions, 6 deletions
diff --git a/man/mshow.1 b/man/mshow.1
index 21c82f5..f58d2ec 100644
--- a/man/mshow.1
+++ b/man/mshow.1
@@ -76,8 +76,10 @@ Like
 .Fl x
 but write to standard output.
 When used together with
-.Fl H ,
-print the headers of the MIME part too.
+.Fl r ,
+the whole part is raw,
+that is,
+un-decoded and including MIME part headers.
 .It Fl t
 Switch to list mode: list all MIME parts
 of each
diff --git a/mshow.c b/mshow.c
index c24f31f..f836b76 100644
--- a/mshow.c
+++ b/mshow.c
@@ -443,13 +443,17 @@ extract_mime(int depth, struct message *msg, char *body, size_t bodylen)
 			if (errno == 0 && !*b && d == mimecount) {
 				// extract by id
 				if (extract_stdout) {
-					if (Hflag) {
+					if (rflag) {
 						fwrite(blaze822_orig_header(msg),
 						    1, blaze822_headerlen(msg),
 						    stdout);
 						printf("\n\n");
+						fwrite(blaze822_body(msg),
+						    1, blaze822_bodylen(msg),
+						    stdout);
+					} else {
+						fwrite(body, 1, bodylen, stdout);
 					}
-					fwrite(body, 1, bodylen, stdout);
 				} else {
 					char buf[255];
 					char *bufptr;
@@ -467,13 +471,17 @@ extract_mime(int depth, struct message *msg, char *body, size_t bodylen)
 				   fnmatch(a, filename, FNM_PATHNAME) == 0) {
 				// extract by name
 				if (extract_stdout) {
-					if (Hflag) {
+					if (rflag) {
 						fwrite(blaze822_orig_header(msg),
 						    1, blaze822_headerlen(msg),
 						    stdout);
 						printf("\n\n");
+						fwrite(blaze822_body(msg),
+						    1, blaze822_bodylen(msg),
+						    stdout);
+					} else {
+						fwrite(body, 1, bodylen, stdout);
 					}
-					fwrite(body, 1, bodylen, stdout);
 				} else {
 					printf("%s\n", filename);
 					writefile(filename, body, bodylen);