diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-12-19 19:32:29 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-12-19 19:35:55 -0800 |
commit | efe05b019ca19328d27c07ef32b4698a7f36166f (patch) | |
tree | a38d3c5713d39370e881c148ff0f5c9d4db59c67 /git-send-email.perl | |
parent | ec9f0ea3e6ecf1237223dec8428e7bb73d339320 (diff) | |
parent | 718258e256b74622aa55f5ee0cb9cff4cce6bf9f (diff) | |
download | git-efe05b019ca19328d27c07ef32b4698a7f36166f.tar.gz git-efe05b019ca19328d27c07ef32b4698a7f36166f.tar.xz |
Merge branch 'maint' to sync with GIT 1.6.0.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-x | git-send-email.perl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index 3112f769c..61144011d 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -20,6 +20,7 @@ use strict; use warnings; use Term::ReadLine; use Getopt::Long; +use Text::ParseWords; use Data::Dumper; use Term::ANSIColor; use File::Temp qw/ tempdir /; @@ -359,6 +360,10 @@ foreach my $entry (@bcclist) { 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 @@ -367,7 +372,7 @@ my %parse_alias = ( 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+(.*)$/) { @@ -379,7 +384,7 @@ my %parse_alias = ( chomp $x; $x .= $1 while(defined($_ = <$fh>) && /^ +(.*)$/); $x =~ /^(\S+)$f\t\(?([^\t]+?)\)?(:?$f){0,2}$/ or next; - $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+?)"\)/) { @@ -588,7 +593,7 @@ if (!@to) { } my $to = $_; - push @to, split /,\s*/, $to; + push @to, split_addrs($to); $prompting++; } |