Skip to content

Commit

Permalink
send-email: Fix Pine address book parsing
Browse files Browse the repository at this point in the history
See:  http://www.washington.edu/pine/tech-notes/low-level.html

Entries with a fcc or comment field after the address weren't parsed
correctly.

Continuation lines, identified by leading spaces, were also not handled.

Distribution lists which had ( ) around a list of addresses did not have
the parenthesis removed.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Trent Piepho authored and Junio C Hamano committed Nov 26, 2008
1 parent f207062 commit 73c427e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,13 @@ sub read_config {
# spaces delimit multiple addresses
$aliases{$1} = [ split(/\s+/, $2) ];
}}},
pine => sub { my $fh = shift; while (<$fh>) {
if (/^(\S+)\t.*\t(.*)$/) {
pine => sub { my $fh = shift; my $f='\t[^\t]*';
for (my $x = ''; defined($x); $x = $_) {
chomp $x;
$x .= $1 while(defined($_ = <$fh>) && /^ +(.*)$/);
$x =~ /^(\S+)$f\t\(?([^\t]+?)\)?(:?$f){0,2}$/ or next;
$aliases{$1} = [ split(/\s*,\s*/, $2) ];
}}},
}},
gnus => sub { my $fh = shift; while (<$fh>) {
if (/\(define-mail-alias\s+"(\S+?)"\s+"(\S+?)"\)/) {
$aliases{$1} = [ $2 ];
Expand Down

0 comments on commit 73c427e

Please sign in to comment.