mblaze

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

commit 55ded86ad5f87865b5bf5b4eded8a1730cea524c
parent cf36745b0c46b1203778ddc40b537905ff3a5d03
Author: Leah Neukirchen <leah@vuxu.org>
Date:   Sat, 21 Jan 2017 17:44:34 +0100

maddr: addr: first decode RFC2047, then parse address

Diffstat:
maddr.c | 13++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/maddr.c b/maddr.c @@ -32,20 +32,19 @@ addr(char *file) v = blaze822_chdr(msg, h); if (v) { char *disp, *addr; + char vdec[1024]; + blaze822_decode_rfc2047(vdec, v, sizeof vdec - 1, "UTF-8"); + vdec[sizeof vdec - 1] = 0; + v = vdec; + while ((v = blaze822_addr(v, &disp, &addr))) { if (disp && addr && strcmp(disp, addr) == 0) disp = 0; if (disp && addr) { - char dispdec[1024]; - blaze822_decode_rfc2047(dispdec, disp, - sizeof dispdec - 1, "UTF-8"); - dispdec[sizeof dispdec - 1] = 0; - if (aflag) printf("%s\n", addr); else - printf("%s <%s>\n", - dispdec, addr); + printf("%s <%s>\n", disp, addr); } else if (addr) { printf("%s\n", addr); }