aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-06-18 01:00:20 +0200
committerLeah Neukirchen <leah@vuxu.org>2021-06-18 01:13:03 +0200
commit0ed7f72d31d01c08082407f11a167552ba75cf0d (patch)
treeaebad9e1b685aacea098ad1ab6f668a5d3e777ee
parent4e0de11300991ef0c1372fb831cef467be0e108a (diff)
downloadmblaze-0ed7f72d31d01c08082407f11a167552ba75cf0d.tar.gz
mblaze-0ed7f72d31d01c08082407f11a167552ba75cf0d.tar.xz
mblaze-0ed7f72d31d01c08082407f11a167552ba75cf0d.zip
mhdr: print_addresses: decode only display part of address
RFC 2047.6.2: NOTE: Decoding and display of encoded-words occurs *after* a structured field body is parsed into tokens.
-rw-r--r--mhdr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mhdr.c b/mhdr.c
index 83bed02..b6e9fa0 100644
--- a/mhdr.c
+++ b/mhdr.c
@@ -87,19 +87,19 @@ void
print_addresses(char *s)
{
char *disp, *addr;
- char sdec[4096];
-
- if (dflag) {
- blaze822_decode_rfc2047(sdec, s, sizeof sdec, "UTF-8");
- sdec[sizeof sdec - 1] = 0;
- s = sdec;
- }
+ char ddec[4096];
while ((s = blaze822_addr(s, &disp, &addr))) {
if (Hflag && addr)
printf("%s\t", curfile);
if (disp && addr) {
+ if (dflag) {
+ blaze822_decode_rfc2047(ddec, disp, sizeof ddec, "UTF-8");
+ ddec[sizeof ddec - 1] = 0;
+ disp = ddec;
+ }
+
print_quoted(disp);
printf(" <%s>\n", addr);
} else if (addr) {