@matheusbsbs / matheus-bagliano / commits / ddfb3696b9
Fork 0

mailinfo: 'From:' header should be unfold as well

At present we do headers unfolding (see RFC822 3.1.1. LONG HEADER FIELDS) for all fields except 'From' (always) and 'Subject' (when keep_subject is set) Not unfolding 'From' is a bug -- see above-mentioned RFC link. Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Kirill Smelkov committed Jan 12, 2009 at 15:22 UTC ddfb3696b91e2a2261b79d0828a7a715e3d71c1e
2 files changed +5 -1
builtin-mailinfo.c
+1
@@ -871,6 +871,7 @@ static void handle_info(void)
871 }
872 output_header_lines(fout, "Subject", hdr);
873 } else if (!memcmp(header[i], "From", 4)) {
874 + cleanup_space(hdr);
875 handle_from(hdr);
876 fprintf(fout, "Author: %s\n", name.buf);
877 fprintf(fout, "Email: %s\n", email.buf);
t/t5100/sample.mbox
+4 -1
@@ -2,7 +2,10 @@
2
3
4 From nobody Mon Sep 17 00:00:00 2001
5 -From: A U Thor <a.u.thor@example.com>
5 +From: A
6 + U
7 + Thor
8 + <a.u.thor@example.com>
9 Date: Fri, 9 Jun 2006 00:44:16 -0700
10 Subject: [PATCH] a commit.
11