Code

Don't dereference a strdup-returned NULL
[git.git] / git-send-email.perl
index a6e3e026199a8d5ce763360c60ee0491f14820a5..7c0c90bd21bbb009de81aa315bed1c947a32c423 100755 (executable)
@@ -154,8 +154,8 @@ if ($@) {
        $term = new FakeTerm "$@: going non-interactive";
 }
 
-my $def_chain = $repo->config_boolean('sendemail.chainreplyto');
-if ($def_chain and $def_chain eq 'false') {
+my $def_chain = $repo->config_bool('sendemail.chainreplyto');
+if (defined $def_chain and not $def_chain) {
     $chain_reply_to = 0;
 }
 
@@ -212,7 +212,7 @@ my $aliasfiletype = $repo->config('sendemail.aliasfiletype');
 my %parse_alias = (
        # multiline formats can be supported in the future
        mutt => sub { my $fh = shift; while (<$fh>) {
-               if (/^alias\s+(\S+)\s+(.*)$/) {
+               if (/^\s*alias\s+(\S+)\s+(.*)$/) {
                        my ($alias, $addr) = ($1, $2);
                        $addr =~ s/#.*$//; # mutt allows # comments
                         # commas delimit multiple addresses
@@ -561,7 +561,8 @@ foreach my $t (@files) {
                                        $subject = $1;
 
                                } elsif (/^(Cc|From):\s+(.*)$/) {
-                                       if ($2 eq $from) {
+                                       if (unquote_rfc2047($2) eq $from) {
+                                               $from = $2;
                                                next if ($suppress_from);
                                        }
                                        elsif ($1 eq 'From') {