diff options
| author | Nickolai Zeldovich <nickolai@csail.mit.edu> | 2013-01-06 20:34:58 -0500 | 
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2013-01-06 23:48:12 -0800 | 
| commit | 6310071abfdf7a925b41a131d518d7636daa7259 (patch) | |
| tree | e99efee286fcd2f0de05e6e3e9519169cd87e97a | |
| parent | 7e2010537e96d0a1144520222f20ba1dc3d61441 (diff) | |
| download | git-6310071abfdf7a925b41a131d518d7636daa7259.tar.gz | |
git-send-email: treat field names as case-insensitively
Field names like To:, Cc:, etc. are case-insensitive; use a
case-insensitive regexp to match them as such.
Previously, git-send-email would fail to pick-up the addresses when
in-body "fake" headers with different cases (e.g. lowercase "cc:")
are manually inserted to the messages it was asked to send, even
though the text will still show them.
Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rwxr-xr-x | git-send-email.perl | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/git-send-email.perl b/git-send-email.perl index aea66a0d47..7198d2ec9a 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1227,10 +1227,10 @@ foreach my $t (@files) {  		}  		if (defined $input_format && $input_format eq 'mbox') { -			if (/^Subject:\s+(.*)$/) { +			if (/^Subject:\s+(.*)$/i) {  				$subject = $1;  			} -			elsif (/^From:\s+(.*)$/) { +			elsif (/^From:\s+(.*)$/i) {  				($author, $author_encoding) = unquote_rfc2047($1);  				next if $suppress_cc{'author'};  				next if $suppress_cc{'self'} and $author eq $sender; @@ -1238,14 +1238,14 @@ foreach my $t (@files) {  					$1, $_) unless $quiet;  				push @cc, $1;  			} -			elsif (/^To:\s+(.*)$/) { +			elsif (/^To:\s+(.*)$/i) {  				foreach my $addr (parse_address_line($1)) {  					printf("(mbox) Adding to: %s from line '%s'\n",  						$addr, $_) unless $quiet;  					push @to, sanitize_address($addr);  				}  			} -			elsif (/^Cc:\s+(.*)$/) { +			elsif (/^Cc:\s+(.*)$/i) {  				foreach my $addr (parse_address_line($1)) {  					if (unquote_rfc2047($addr) eq $sender) {  						next if ($suppress_cc{'self'}); @@ -1267,7 +1267,7 @@ foreach my $t (@files) {  			elsif (/^Message-Id: (.*)/i) {  				$message_id = $1;  			} -			elsif (!/^Date:\s/ && /^[-A-Za-z]+:\s+\S/) { +			elsif (!/^Date:\s/i && /^[-A-Za-z]+:\s+\S/) {  				push @xh, $_;  			} | 
