[PATCH] send-email: do not leave an empty CC: line if no cc is present.

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

 



Signed-off-by: Junio C Hamano <junkio@xxxxxxx>
---

 * I've almost never used send-email myself, but I decided that
   I should eat somebody's dog food I inherited.  Once I got
   annoyed enough, I may end up rewriting large portions of it,
   perhaps.

 git-send-email.perl |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 1278fcb..d6b1548 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -446,9 +446,12 @@ sub send_message
 		my ($name, $addr) = ($from =~ /^(.*?)(\s+<.*)/);
 		$from = "\"$name\"$addr";
 	}
+	my $ccline = "";
+	if ($cc ne '') {
+		$ccline = "\nCc: $cc";
+	}
 	my $header = "From: $from
-To: $to
-Cc: $cc
+To: $to${ccline}
 Subject: $subject
 Date: $date
 Message-Id: $message_id
-- 
1.5.1.1.821.g88bdb

-
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]