Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-05-22 04:15:06 +0400
committerJunio C Hamano <junkio@cox.net>2006-05-22 04:37:46 +0400
commit81c5cf786581c82a8834726ffef26b7def96bf35 (patch)
treee211810453abd5f22751ca23e9bda2f18c33c890 /mailinfo.c
parentd5e3d60c200b214e36eacfb3de21044a7efd1971 (diff)
mailinfo: skip bogus UNIX From line inside body
Sometimes people just include the whole format-patch output in the commit e-mail. Detect it and skip the bogus ">From " line. Signed-off-by: Junio C Hamano <junkio@cox.net>
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;