trpview -e now will print all found headers - rohrpost - A commandline mail client to change the world as we see it.
 (HTM) git clone git://r-36.net/rohrpost
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 69919855802099ad2545aa21c4cfa9683a9d2dc8
 (DIR) parent 8c96b677737e7ae1765122d88b0db536043478e8
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Tue, 24 Jul 2012 11:47:57 +0200
       
       rpview -e now will print all found headers
       
       Diffstat:
         view.c                              |      30 ++++++++++++++++--------------
       
       1 file changed, 16 insertions(+), 14 deletions(-)
       ---
 (DIR) diff --git a/view.c b/view.c
       t@@ -130,7 +130,7 @@ view_printpart(char *id, mime_t *mime, llist_t *dhdrs, llist_t *partl,
                llistelem_t *delem, *helem, *part;
                char *hvalue, *textplainid;
                int didprint, inpartl;
       -        llist_t *alpartl;
       +        llist_t *alpartl, *hlist;
        
                inpartl = 0;
                if (partl != NULL && llist_get(partl, mime->partid))
       t@@ -154,20 +154,22 @@ view_printpart(char *id, mime_t *mime, llist_t *dhdrs, llist_t *partl,
                                }
                        } else {
                                forllist(dhdrs, delem) {
       -                                helem = llist_ciget(mime->hdrs, delem->key);
       -                                if (helem != NULL) {
       -                                        hvalue = mime_decodeheader(
       -                                                        (char *)helem->data);
       -                                        if (hvalue == NULL)
       -                                                continue;
       -                                        if (options & PRINT_VALUE) {
       -                                                printf("%s\n", hvalue);
       -                                        } else {
       -                                                printf("%s: %s\n", helem->key,
       -                                                                hvalue);
       +                                hlist = llist_find(mime->hdrs, delem->key);
       +                                if (hlist != NULL) {
       +                                        forllist(hlist, helem) {
       +                                                hvalue = mime_decodeheader(
       +                                                                (char *)helem->data);
       +                                                if (hvalue == NULL)
       +                                                        continue;
       +                                                if (options & PRINT_VALUE) {
       +                                                        printf("%s\n", hvalue);
       +                                                } else {
       +                                                        printf("%s: %s\n", helem->key,
       +                                                                        hvalue);
       +                                                }
       +                                                free(hvalue);
       +                                                didprint = 1;
                                                }
       -                                        free(hvalue);
       -                                        didprint = 1;
                                        }
                                }
                        }