Skip to content

Commit ddfb369

Browse files
navytuxgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 353aaf2 commit ddfb369

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

builtin-mailinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ static void handle_info(void)
871871
}
872872
output_header_lines(fout, "Subject", hdr);
873873
} else if (!memcmp(header[i], "From", 4)) {
874+
cleanup_space(hdr);
874875
handle_from(hdr);
875876
fprintf(fout, "Author: %s\n", name.buf);
876877
fprintf(fout, "Email: %s\n", email.buf);

t/t5100/sample.mbox

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33

44
From nobody Mon Sep 17 00:00:00 2001
5-
From: A U Thor <[email protected]>
5+
From: A
6+
U
7+
Thor
8+
69
Date: Fri, 9 Jun 2006 00:44:16 -0700
710
Subject: [PATCH] a commit.
811

0 commit comments

Comments
 (0)