mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 5eb7837aa8706b0050dee2fd6a2eb5d41510d18d
parent 7575e07b9f10fc115b62022a9cc96098f072afac
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Sat,  6 Aug 2016 19:28:25 +0200

mshow: simplify -H with orig_header

Diffstat:
mshow.c | 15+++------------
1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/mshow.c b/mshow.c @@ -601,7 +601,7 @@ show(char *file) } newcur = strdup(file); - if (qflag) + if (qflag && !Hflag) msg = blaze822(file); else msg = blaze822_file(file); @@ -611,17 +611,8 @@ show(char *file) } if (Hflag) { // raw headers - size_t hl = blaze822_headerlen(msg); - char *header = malloc(hl); - if (!header) - return; - int fd = open(file, O_RDONLY); - if (fd == -1) { - free(header); - return; - } - hl = read(fd, header, hl); - fwrite(header, 1, hl, stdout); + fwrite(blaze822_orig_header(msg), 1, blaze822_headerlen(msg), + stdout); printf("\n"); } else if (Lflag) { // all headers char *h = 0;