summaryrefslogtreecommitdiff
path: root/mailinfo.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-05-21 17:37:54 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-05-21 17:37:54 -0700
commit7b8e4ab07c6ebc72e311804c9c79ef93cfbbe704 (patch)
tree6cd08641883391adac6e12352017eb544df0f7e8 /mailinfo.c
parentMerge branch 'js/fmt-patch' into next (diff)
parentmailinfo: skip bogus UNIX From line inside body (diff)
downloadtgif-7b8e4ab07c6ebc72e311804c9c79ef93cfbbe704.tar.xz
Merge branch 'jc/mailinfo' into next
* jc/mailinfo: mailinfo: skip bogus UNIX From line inside body tutorial-2: typofix in examples. tutorial: add discussion of index file, object database tutorial: expanded discussion of commit history tutorial: replace "whatchanged" by "log" NO_INET_NTOP and compat/inet_ntop.c for some systems (e.g. old Cygwin). remove superflous "const" checkdiff_consume: strtol parameter fix. Elaborate on why ':' is a bad idea in a ref name. Reference git-check-ref-format in git-branch.
Diffstat (limited to 'mailinfo.c')
-rw-r--r--mailinfo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mailinfo.c b/mailinfo.c
index b27651935d..a133e6d08a 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -237,10 +237,17 @@ static int eatspace(char *line)
#define SEEN_FROM 01
#define SEEN_DATE 02
#define SEEN_SUBJECT 04
+#define SEEN_BOGUS_UNIX_FROM 010
/* First lines of body can have From:, Date:, and Subject: */
static int 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;
+ }
+ }
if (!memcmp("From:", line, 5) && isspace(line[5])) {
if (!(*seen & SEEN_FROM) && handle_from(line+6)) {
*seen |= SEEN_FROM;