Code

send-email: do not leave an empty CC: line if no cc is present.
authorJunio C Hamano <junkio@cox.net>
Mon, 16 Apr 2007 23:51:47 +0000 (16:51 -0700)
committerJunio C Hamano <junkio@cox.net>
Mon, 16 Apr 2007 23:51:47 +0000 (16:51 -0700)
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-send-email.perl

index 1278fcba462f632a3687742f74cc15c0498874e2..d6b15480dc1e211f0653ff54963889464dad3573 100755 (executable)
@@ -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