[PATCH RFC3.5.1 08/12] send-email: Simplify --compose subject sanitation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We might as well use the global variables while they exist; there's
no reason to print the result to a file and then read it back in.

Also, the entire file is already read and checked for:

	/[^[:ascii:]]/

by:

	my $need_8bit_cte = file_has_nonascii($compose_filename);

so we might as well use $need_8bit_cte until something less egregiously
inefficient is implemented.

Signed-off-by: Michael Witten <mfwitten@xxxxxxxxx>
---
 git-send-email.perl |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 3894a93..1f815d7 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -675,13 +675,8 @@ EOT
 		} elsif (/^MIME-Version:/i) {
 			$need_8bit_cte = 0;
 		} elsif (/^Subject:\s*(.+)\s*$/i) {
-			$initial_subject = $1;
-			my $subject = $initial_subject;
-			$_ = "Subject: " .
-				($subject =~ /[^[:ascii:]]/ ?
-				 quote_rfc2047($subject) :
-				 $subject) .
-				"\n";
+			$initial_subject = $need_8bit_cte ? quote_rfc2047($1) : $1;
+			next;
 		} elsif (/^In-Reply-To:\s*(.+)\s*$/i) {
 			$initial_reply_to = $1;
 			next;
-- 
1.6.2.2.479.g2aec

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]