Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-send-email: handle email address with quoted comma
author
Wu Fengguang
<fengguang.wu@intel.com>
Fri, 19 Dec 2008 08:10:10 +0000
(16:10 +0800)
committer
Junio C Hamano
<gitster@pobox.com>
Sat, 20 Dec 2008 03:10:48 +0000
(19:10 -0800)
Correctly handle email addresses containing quoted commas, e.g.
"Zhu, Yi" <yi.zhu@intel.com>, "Li, Shaohua" <shaohua.li@intel.com>
The commas inside the double quotes are not separators.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
04c8ce9
)
diff --git
a/git-send-email.perl
b/git-send-email.perl
index 18529c76e665e613d9c116e32da6acf31b3eac6a..449d938ba97cf1db47049a2f514bea1ed220044b 100755
(executable)
--- a/
git-send-email.perl
+++ b/
git-send-email.perl
@@
-20,6
+20,7
@@
use warnings;
use Term::ReadLine;
use Getopt::Long;
use warnings;
use Term::ReadLine;
use Getopt::Long;
+use Text::ParseWords;
use Data::Dumper;
use Term::ANSIColor;
use Git;
use Data::Dumper;
use Term::ANSIColor;
use Git;
@@
-363,6
+364,10
@@
sub read_config {
die "Comma in --bcclist entry: $entry'\n" unless $entry !~ m/,/;
}
die "Comma in --bcclist entry: $entry'\n" unless $entry !~ m/,/;
}
+sub split_addrs {
+ return parse_line('\s*,\s*', 1, @_);
+}
+
my %aliases;
my %parse_alias = (
# multiline formats can be supported in the future
my %aliases;
my %parse_alias = (
# multiline formats can be supported in the future
@@
-371,7
+376,7
@@
sub read_config {
my ($alias, $addr) = ($1, $2);
$addr =~ s/#.*$//; # mutt allows # comments
# commas delimit multiple addresses
my ($alias, $addr) = ($1, $2);
$addr =~ s/#.*$//; # mutt allows # comments
# commas delimit multiple addresses
- $aliases{$alias} = [ split
(/\s*,\s*/,
$addr) ];
+ $aliases{$alias} = [ split
_addrs(
$addr) ];
}}},
mailrc => sub { my $fh = shift; while (<$fh>) {
if (/^alias\s+(\S+)\s+(.*)$/) {
}}},
mailrc => sub { my $fh = shift; while (<$fh>) {
if (/^alias\s+(\S+)\s+(.*)$/) {
@@
-380,7
+385,7
@@
sub read_config {
}}},
pine => sub { my $fh = shift; while (<$fh>) {
if (/^(\S+)\t.*\t(.*)$/) {
}}},
pine => sub { my $fh = shift; while (<$fh>) {
if (/^(\S+)\t.*\t(.*)$/) {
- $aliases{$1} = [ split
(/\s*,\s*/,
$2) ];
+ $aliases{$1} = [ split
_addrs(
$2) ];
}}},
gnus => sub { my $fh = shift; while (<$fh>) {
if (/\(define-mail-alias\s+"(\S+?)"\s+"(\S+?)"\)/) {
}}},
gnus => sub { my $fh = shift; while (<$fh>) {
if (/\(define-mail-alias\s+"(\S+?)"\s+"(\S+?)"\)/) {
@@
-458,7
+463,7
@@
sub read_config {
}
my $to = $_;
}
my $to = $_;
- push @to, split
/,\s*/, $to
;
+ push @to, split
_addrs($to)
;
$prompting++;
}
$prompting++;
}