From: Junio C Hamano Date: Tue, 23 May 2006 21:57:00 +0000 (-0700) Subject: Merge branch 'eb/mailinfo' into next X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=33b292610dea9f94c986eb88f12e503f5b8375dd;p=git.git Merge branch 'eb/mailinfo' into next * eb/mailinfo: Allow in body headers beyond the in body header prefix. More accurately detect header lines in read_one_header_line In handle_body only read a line if we don't already have one. Refactor commit messge handling. Move B and Q decoding into check header. Make read_one_header_line return a flag not a length. --- 33b292610dea9f94c986eb88f12e503f5b8375dd diff --cc mailinfo.c index a133e6d0,241bfb9e..78d2a15d --- a/mailinfo.c +++ b/mailinfo.c @@@ -237,17 -240,11 +240,18 @@@ static int eatspace(char *line #define SEEN_FROM 01 #define SEEN_DATE 02 #define SEEN_SUBJECT 04 -#define SEEN_PREFIX 0x08 +#define SEEN_BOGUS_UNIX_FROM 010 ++#define SEEN_PREFIX 020 /* First lines of body can have From:, Date:, and Subject: */ - static int handle_inbody_header(int *seen, char *line) + static void handle_inbody_header(int *seen, char *line) { + if (!memcmp(">From", line, 5) && isspace(line[5])) { + if (!(*seen & SEEN_BOGUS_UNIX_FROM)) { + *seen |= SEEN_BOGUS_UNIX_FROM; - return 1; ++ return; + } + } if (!memcmp("From:", line, 5) && isspace(line[5])) { if (!(*seen & SEEN_FROM) && handle_from(line+6)) { *seen |= SEEN_FROM;