Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
mailinfo: skip bogus UNIX From line inside body
author
Junio C Hamano
<junkio@cox.net>
Mon, 22 May 2006 00:15:06 +0000
(17:15 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Mon, 22 May 2006 00:37:46 +0000
(17:37 -0700)
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>
mailinfo.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
d5e3d60
)
diff --git
a/mailinfo.c
b/mailinfo.c
index b27651935db85cf0ab651d523c502943d137b7cd..a133e6d08aa69a5b19f6f232729b7dd108a630d6 100644
(file)
--- 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_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)
{
/* 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;
if (!memcmp("From:", line, 5) && isspace(line[5])) {
if (!(*seen & SEEN_FROM) && handle_from(line+6)) {
*seen |= SEEN_FROM;