about summary refs log tree commit diff
path: root/mshow.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-06 19:30:45 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-06 19:30:45 +0200
commit2776c838fe43e56260f44f63b12536bd41787d8c (patch)
tree775dbbe44fc66faec7b9cf056103d659b2dad041 /mshow.c
parent5eb7837aa8706b0050dee2fd6a2eb5d41510d18d (diff)
downloadmblaze-2776c838fe43e56260f44f63b12536bd41787d8c.tar.gz
mblaze-2776c838fe43e56260f44f63b12536bd41787d8c.tar.xz
mblaze-2776c838fe43e56260f44f63b12536bd41787d8c.zip
mshow: extract headers with -H -O
Diffstat (limited to 'mshow.c')
-rw-r--r--mshow.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mshow.c b/mshow.c
index c7bb43d..c24f31f 100644
--- a/mshow.c
+++ b/mshow.c
@@ -443,6 +443,12 @@ 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) {
+						fwrite(blaze822_orig_header(msg),
+						    1, blaze822_headerlen(msg),
+						    stdout);
+						printf("\n\n");
+					}
 					fwrite(body, 1, bodylen, stdout);
 				} else {
 					char buf[255];
@@ -461,6 +467,12 @@ 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) {
+						fwrite(blaze822_orig_header(msg),
+						    1, blaze822_headerlen(msg),
+						    stdout);
+						printf("\n\n");
+					}
 					fwrite(body, 1, bodylen, stdout);
 				} else {
 					printf("%s\n", filename);