git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: your mail

From
Junio C Hamano <junkio@cox.net>
Date
May 22, 2006, 00:16 UTC
Message-ID
<7vk68ehq1f.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060521235514.GC23096@fieldses.org>
"J. Bruce Fields" <bfields@fieldses.org> writes:
Show 6 quoted lines
> On Sun, May 21, 2006 at 07:53:18PM -0400, J. Bruce Fields wrote:
>> >From nobody Mon Sep 17 00:00:00 2001
>> From: J. Bruce Fields <bfields@citi.umich.edu>
>
> Oops, sorry, I screwed up sending those; let me know if you'd like them
> resent....
That's OK.  I just cooked up this one ;-).
-- >8 --
From 03946787890c12fbb6ecfbe0382cbf02ac209801 Mon Sep 17 00:00:00 2001
From: Junio C Hamano <junkio@cox.net>
Date: Sun, 21 May 2006 17:15:06 -0700
Subject: [PATCH] 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>
---
 mailinfo.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/mailinfo.c b/mailinfo.c
index b276519..a133e6d 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;
-- 
1.3.3.g292f
Previous: J. Bruce FieldsNext: J. Bruce Fields
Message 12 of 14 in “(unknown)”
  1. J. Bruce FieldsMay 21, 2006
  2. J. Bruce FieldsMay 21, 2006
  3. J. Bruce FieldsMay 21, 2006
  4. Junio C HamanoMay 22, 2006
  5. J. Bruce FieldsMay 22, 2006
  6. Jakub NarebskiMay 22, 2006
  7. Jakub NarebskiMay 22, 2006
  8. Junio C HamanoMay 22, 2006
  9. Jakub NarebskiMay 22, 2006
  10. J. Bruce FieldsMay 22, 2006
  11. J. Bruce FieldsMay 21, 2006
  12. Junio C HamanoMay 22, 2006
  13. J. Bruce FieldsMay 22, 2006
  14. git help: remove whatchanged from list of common commandsMartin Waitz, May 22, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.