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

[PATCH] git-send-email: fix handling of special characters

From
MTMichael S. Tsirkin <mst@redhat.com>
Date
May 23, 2013, 13:54 UTC
Message-ID
<20130523135418.GA20741@redhat.com>

When patch sender's name has special characters, git send-email did not quote it before matching against the author name. As a result it would produce mail like this:

	Date: Thu, 23 May 2013 16:36:00 +0300
	From: "Michael S. Tsirkin" <mst@redhat.com>
	To: qemu-devel@nongnu.org
	Cc: "Michael S. Tsirkin" <mst@redhat.com>
	Subject: [PATCH 0/9] virtio: switch to linux headers
	Message-Id: <1369316169-20181-1-git-send-email-mst@redhat.com>
	From: "Michael S. Tsirkin" <mst@redhat.com>
Fix by sanitizing before matching to patch author name.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 git-send-email.perl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index bd13cc8..c4dc438 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1400,7 +1400,8 @@ foreach my $t (@files) {
 		$subject = quote_subject($subject, $auto_8bit_encoding);
 	}
 
-	if (defined $author and $author ne $sender) {
+	my $sanitized_sender = sanitize_address($sender);
+	if (defined $author and $author ne $sanitized_sender) {
 		$message = "From: $author\n\n$message";
 		if (defined $author_encoding) {
 			if ($has_content_type) {
-- 
MST
Next: Junio C Hamano
Message 1 of 6 in “git-send-email: fix handling of special characters”
  1. git-send-email: fix handling of special charactersMichael S. Tsirkin, May 23, 2013
  2. Junio C HamanoMay 23, 2013
  3. Junio C HamanoMay 23, 2013
  4. Michael S. TsirkinMay 23, 2013
  5. Junio C HamanoMay 23, 2013
  6. Michael S. TsirkinMay 23, 2013

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.