mshow: rather, use -r -O to print the part raw

pull/2/head
Christian Neukirchen 8 years ago
parent 2776c838fe
commit 7377f0dfc3

@ -76,8 +76,10 @@ Like
.Fl x .Fl x
but write to standard output. but write to standard output.
When used together with When used together with
.Fl H , .Fl r ,
print the headers of the MIME part too. the whole part is raw,
that is,
un-decoded and including MIME part headers.
.It Fl t .It Fl t
Switch to list mode: list all MIME parts Switch to list mode: list all MIME parts
of each of each

@ -443,13 +443,17 @@ extract_mime(int depth, struct message *msg, char *body, size_t bodylen)
if (errno == 0 && !*b && d == mimecount) { if (errno == 0 && !*b && d == mimecount) {
// extract by id // extract by id
if (extract_stdout) { if (extract_stdout) {
if (Hflag) { if (rflag) {
fwrite(blaze822_orig_header(msg), fwrite(blaze822_orig_header(msg),
1, blaze822_headerlen(msg), 1, blaze822_headerlen(msg),
stdout); stdout);
printf("\n\n"); printf("\n\n");
fwrite(blaze822_body(msg),
1, blaze822_bodylen(msg),
stdout);
} else {
fwrite(body, 1, bodylen, stdout);
} }
fwrite(body, 1, bodylen, stdout);
} else { } else {
char buf[255]; char buf[255];
char *bufptr; char *bufptr;
@ -467,13 +471,17 @@ extract_mime(int depth, struct message *msg, char *body, size_t bodylen)
fnmatch(a, filename, FNM_PATHNAME) == 0) { fnmatch(a, filename, FNM_PATHNAME) == 0) {
// extract by name // extract by name
if (extract_stdout) { if (extract_stdout) {
if (Hflag) { if (rflag) {
fwrite(blaze822_orig_header(msg), fwrite(blaze822_orig_header(msg),
1, blaze822_headerlen(msg), 1, blaze822_headerlen(msg),
stdout); stdout);
printf("\n\n"); printf("\n\n");
fwrite(blaze822_body(msg),
1, blaze822_bodylen(msg),
stdout);
} else {
fwrite(body, 1, bodylen, stdout);
} }
fwrite(body, 1, bodylen, stdout);
} else { } else {
printf("%s\n", filename); printf("%s\n", filename);
writefile(filename, body, bodylen); writefile(filename, body, bodylen);

Loading…
Cancel
Save