git remote update: Fallback to remote if group does not exist
[gitweb.git] / git-send-email.perl
index d790660bcf7bdc68a8edee6a2826447da931a9cc..6bbdfec84983b23d3ab380e63975987b6078b4ca 100755 (executable)
@@ -687,7 +687,7 @@ sub expand_aliases {
 
 # Variables we set as part of the loop over files
 our ($message_id, %mail, $subject, $reply_to, $references, $message,
-       $needs_confirm, $message_num);
+       $needs_confirm, $message_num, $ask_default);
 
 sub extract_valid_address {
        my $address = shift;
@@ -776,12 +776,13 @@ sub sanitize_address
        }
 
        # if recipient_name is already quoted, do nothing
-       if ($recipient_name =~ /^(".*"|=\?utf-8\?q\?.*\?=)$/) {
+       if ($recipient_name =~ /^("[[:ascii:]]*"|=\?utf-8\?q\?.*\?=)$/) {
                return $recipient;
        }
 
        # rfc2047 is needed if a non-ascii char is included
        if ($recipient_name =~ /[^[:ascii:]]/) {
+               $recipient_name =~ s/^"(.*)"$/$1/;
                $recipient_name = quote_rfc2047($recipient_name);
        }
 
@@ -845,7 +846,6 @@ sub send_message
 
        if ($needs_confirm && !$dry_run) {
                print "\n$header\n";
-               my $ask_default;
                if ($needs_confirm eq "inform") {
                        $confirm_unconfigured = 0; # squelch this message for the rest of this run
                        $ask_default = "y"; # assume yes on EOF since user hasn't explicitly asked for confirmation