Skip to content

Commit

Permalink
mhdr: print_addresses: decode only display part of address
Browse files Browse the repository at this point in the history
RFC 2047.6.2:
   NOTE: Decoding and display of encoded-words occurs *after* a
   structured field body is parsed into tokens.
  • Loading branch information
leahneukirchen committed Jun 17, 2021
1 parent 4e0de11 commit 0ed7f72
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mhdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0ed7f72

Please sign in to comment.