Skip to content

Commit cea1e2e

Browse files
committed
Merge branch 'nz/send-email-headers-are-case-insensitive' into maint
When users spell "cc:" in lowercase in the fake "header" in the trailer part, "git send-email" failed to pick up the addresses from there. As e-mail headers field names are case insensitive, this script should follow suit and treat "cc:" and "Cc:" the same way. * nz/send-email-headers-are-case-insensitive: git-send-email: treat field names as case-insensitively
2 parents ca7ccd5 + 6310071 commit cea1e2e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

git-send-email.perl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,25 +1285,25 @@ sub send_message {
12851285
}
12861286

12871287
if (defined $input_format && $input_format eq 'mbox') {
1288-
if (/^Subject:\s+(.*)$/) {
1288+
if (/^Subject:\s+(.*)$/i) {
12891289
$subject = $1;
12901290
}
1291-
elsif (/^From:\s+(.*)$/) {
1291+
elsif (/^From:\s+(.*)$/i) {
12921292
($author, $author_encoding) = unquote_rfc2047($1);
12931293
next if $suppress_cc{'author'};
12941294
next if $suppress_cc{'self'} and $author eq $sender;
12951295
printf("(mbox) Adding cc: %s from line '%s'\n",
12961296
$1, $_) unless $quiet;
12971297
push @cc, $1;
12981298
}
1299-
elsif (/^To:\s+(.*)$/) {
1299+
elsif (/^To:\s+(.*)$/i) {
13001300
foreach my $addr (parse_address_line($1)) {
13011301
printf("(mbox) Adding to: %s from line '%s'\n",
13021302
$addr, $_) unless $quiet;
13031303
push @to, $addr;
13041304
}
13051305
}
1306-
elsif (/^Cc:\s+(.*)$/) {
1306+
elsif (/^Cc:\s+(.*)$/i) {
13071307
foreach my $addr (parse_address_line($1)) {
13081308
if (unquote_rfc2047($addr) eq $sender) {
13091309
next if ($suppress_cc{'self'});
@@ -1325,7 +1325,7 @@ sub send_message {
13251325
elsif (/^Message-Id: (.*)/i) {
13261326
$message_id = $1;
13271327
}
1328-
elsif (!/^Date:\s/ && /^[-A-Za-z]+:\s+\S/) {
1328+
elsif (!/^Date:\s/i && /^[-A-Za-z]+:\s+\S/) {
13291329
push @xh, $_;
13301330
}
13311331

0 commit comments

Comments
 (0)