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

[PATCH] git-imap-send bugfix: Allow lines starting with "From " in body

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Mar 21, 2010, 18:47 UTC
Message-ID
<f3271551003211147x538d7682wc67dcc4f914ed97c@mail.gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 Documentation/git-imap-send.txt |    5 -----
 imap-send.c                     |    8 +++++++-
 2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/Documentation/git-imap-send.txt b/Documentation/git-imap-send.txt
index 6cafbe2..ed9d3ce 100644
--- a/Documentation/git-imap-send.txt
+++ b/Documentation/git-imap-send.txt
@@ -123,11 +123,6 @@ users may wish to visit this web page for more information:
   http://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email


-BUGS
-----
-Doesn't handle lines starting with "From " in the message body.
-
-
 Author
 ------
 Derived from isync 1.0.1 by Mike McCormack.
diff --git a/imap-send.c b/imap-send.c
index aeb2985..3163bb9 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -1431,8 +1431,14 @@ static int count_messages(struct msg_data *msg)

 	while (1) {
 		if (!prefixcmp(p, "From ")) {
+			p = strstr(p+5, "\nFrom: ");
+			if (!p) break;
+			p = strstr(p+7, "\nDate: ");
+			if (!p) break;
+			p = strstr(p+7, "\nSubject: ");
+			if (!p) break;
 			count++;
-			p += 5;
+			p += 10;
 		}
 		p = strstr(p+5, "\nFrom ");
 		if (!p)
-- 
1.7.0
Next: Junio C Hamano
Message 1 of 3 in “git-imap-send bugfix: Allow lines starting with "From " in body”
  1. git-imap-send bugfix: Allow lines starting with "From " in bodyRamkumar Ramachandra, Mar 21, 2010
  2. Junio C HamanoMar 21, 2010
  3. Ramkumar RamachandraMar 22, 2010

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.