Skip to contentSkip to conversation

git-send-email: another fix for special characters

PATCH New Michael S. Tsirkin 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-send-email: another fix for special characters

When patch sender's name has special characters,
git send-email did not quote it before matching
against the author name.
As a result suppress_cc = self did not work:
sender is still Cc'd.

Fix by sanitizing before matching to patch author name.

---
 git-send-email.perl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
git-send-email.perl +4 -1
index c4dc438..a3fed7c 100755
@@ -1309,7 +1309,10 @@ foreach my $t (@files) {
 			elsif (/^From:\s+(.*)$/i) {
 				($author, $author_encoding) = unquote_rfc2047($1);
 				next if $suppress_cc{'author'};
-				next if $suppress_cc{'self'} and $author eq $sender;
+				if ($suppress_cc{'self'}) {
+                                    my $sanitized_sender = sanitize_address($sender);
+                                    next if $author eq $sanitized_sender;
+                                }
 				printf("(mbox) Adding cc: %s from line '%s'\n",
 					$1, $_) unless $quiet;
 				push @cc, $1;
Signature · 1 line
MST