summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2016-01-04 20:53:30 +0000
committerJunio C Hamano <gitster@pobox.com>2016-01-04 13:35:40 -0800
commit2c510f21cd2c571549cf75ff94061a2a6717851f (patch)
tree1940a04a61e46b431e166a0fc01714e52e3acc5e /git-send-email.perl
parenta2558fb8e1e387b630312311e1d22c95663da5d0 (diff)
downloadgit-2c510f21cd2c571549cf75ff94061a2a6717851f.tar.gz
git-send-email: do not double-escape quotes from muttew/send-email-mutt-alias-fix
mutt saves aliases with escaped quotes in the form of: alias dot \"Dot U. Sir\" <somebody@example.org> When we pass through our sanitize_address routine, we end up with double-escaping: To: "\\\"Dot U. Sir\\\" <somebody@example.org> Remove the escaping in mutt only for now, as I am not sure if other mailers can do this or if this is better fixed in sanitize_address. Cc: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> Cc: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index e1e9b1460c..6c140e4ef6 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -493,8 +493,13 @@ my %parse_alias = (
if (/^\s*alias\s+(?:-group\s+\S+\s+)*(\S+)\s+(.*)$/) {
my ($alias, $addr) = ($1, $2);
$addr =~ s/#.*$//; # mutt allows # comments
- # commas delimit multiple addresses
- $aliases{$alias} = [ split_addrs($addr) ];
+ # commas delimit multiple addresses
+ my @addr = split_addrs($addr);
+
+ # quotes may be escaped in the file,
+ # unescape them so we do not double-escape them later.
+ s/\\"/"/g foreach @addr;
+ $aliases{$alias} = \@addr
}}},
mailrc => sub { my $fh = shift; while (<$fh>) {
if (/^alias\s+(\S+)\s+(.*)$/) {