Skip to content

Commit 73c427e

Browse files
Trent Piephogitster
authored andcommitted
send-email: Fix Pine address book parsing
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>
1 parent f207062 commit 73c427e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

git-send-email.perl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,13 @@ sub read_config {
345345
# spaces delimit multiple addresses
346346
$aliases{$1} = [ split(/\s+/, $2) ];
347347
}}},
348-
pine => sub { my $fh = shift; while (<$fh>) {
349-
if (/^(\S+)\t.*\t(.*)$/) {
348+
pine => sub { my $fh = shift; my $f='\t[^\t]*';
349+
for (my $x = ''; defined($x); $x = $_) {
350+
chomp $x;
351+
$x .= $1 while(defined($_ = <$fh>) && /^ +(.*)$/);
352+
$x =~ /^(\S+)$f\t\(?([^\t]+?)\)?(:?$f){0,2}$/ or next;
350353
$aliases{$1} = [ split(/\s*,\s*/, $2) ];
351-
}}},
354+
}},
352355
gnus => sub { my $fh = shift; while (<$fh>) {
353356
if (/\(define-mail-alias\s+"(\S+?)"\s+"(\S+?)"\)/) {
354357
$aliases{$1} = [ $2 ];

0 commit comments

Comments
 (0)