l10n: fr.po v2.5.0-rc0 (2355t)
[gitweb.git] / git-send-email.perl
index e1e9b1460ced5f660b32796890df7336bc3d01af..ae9f8698c5a4842c2c0d63db51dde067ddeeb1c9 100755 (executable)
@@ -487,6 +487,37 @@ sub split_addrs {
 }
 
 my %aliases;
+
+sub parse_sendmail_alias {
+       local $_ = shift;
+       if (/"/) {
+               print STDERR "warning: sendmail alias with quotes is not supported: $_\n";
+       } elsif (/:include:/) {
+               print STDERR "warning: `:include:` not supported: $_\n";
+       } elsif (/[\/|]/) {
+               print STDERR "warning: `/file` or `|pipe` redirection not supported: $_\n";
+       } elsif (/^(\S+?)\s*:\s*(.+)$/) {
+               my ($alias, $addr) = ($1, $2);
+               $aliases{$alias} = [ split_addrs($addr) ];
+       } else {
+               print STDERR "warning: sendmail line is not recognized: $_\n";
+       }
+}
+
+sub parse_sendmail_aliases {
+       my $fh = shift;
+       my $s = '';
+       while (<$fh>) {
+               chomp;
+               next if /^\s*$/ || /^\s*#/;
+               $s .= $_, next if $s =~ s/\\$// || s/^\s+//;
+               parse_sendmail_alias($s) if $s;
+               $s = $_;
+       }
+       $s =~ s/\\$//; # silently tolerate stray '\' on last line
+       parse_sendmail_alias($s) if $s;
+}
+
 my %parse_alias = (
        # multiline formats can be supported in the future
        mutt => sub { my $fh = shift; while (<$fh>) {
@@ -515,7 +546,7 @@ sub split_addrs {
                               $aliases{$alias} = [ split_addrs($addr) ];
                          }
                      } },
-
+       sendmail => \&parse_sendmail_aliases,
        gnus => sub { my $fh = shift; while (<$fh>) {
                if (/\(define-mail-alias\s+"(\S+?)"\s+"(\S+?)"\)/) {
                        $aliases{$1} = [ $2 ];