@matheusbsbs / matheus-bagliano / commits / 2dec02b1ec
Fork 0

Allow in body headers beyond the in body header prefix.

- handle_from is fixed to not mangle it's input line. - Then handle_inbody_header is allowed to look in the body of a commit message for additional headers that we haven't already seen. This allows patches with all of the right information in unfortunate places to be imported. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Eric W. Biederman committed May 23, 2006 at 13:58 UTC 2dec02b1ecafc47d4031d0a68a94c775a6a9ff9e
1 file changed +5 -4
mailinfo.c
+5 -4
@@ -72,11 +72,14 @@ static int bogus_from(char *line)
72 return 1;
73 }
74
75 -static int handle_from(char *line)
75 +static int handle_from(char *in_line)
76 {
77 - char *at = strchr(line, '@');
77 + char line[1000];
78 + char *at;
79 char *dst;
80
81 + strcpy(line, in_line);
82 + at = strchr(line, '@');
83 if (!at)
84 return bogus_from(line);
85
@@ -242,8 +245,6 @@ static int eatspace(char *line)
245 /* First lines of body can have From:, Date:, and Subject: */
246 static void handle_inbody_header(int *seen, char *line)
247 {
245 - if (*seen & SEEN_PREFIX)
246 - return;
248 if (!memcmp("From:", line, 5) && isspace(line[5])) {
249 if (!(*seen & SEEN_FROM) && handle_from(line+6)) {
250 *seen |= SEEN_FROM;