[PATCH 1/3 v2] send-email: correct logic error with --suppress-cc=cc
- From
Jay Soffian <jaysoffian@gmail.com>
- Date
- Feb 14, 2009, 06:21 UTC
- Message-ID
- <1234592519-71980-1-git-send-email-jaysoffian@gmail.com>
- In-Reply-To
- <1234583491-61260-2-git-send-email-jaysoffian@gmail.com>
--suppress-cc=cc is supposed to suppress harvesting addresses from any Cc: lines. However, in the case where the Cc: line contained the sender, it would only suppress if --suppress-cc=self.
Signed-off-by: Jay Soffian <jaysoffian@gmail.com> --- And here's a re-roll of this one. Sheesh, that logic was too subtle for my brain. I think it's a lot more obvious what is going on after this patch.
I apologize that this thread is getting so dense. Here it is on gmane which may help:
http://thread.gmane.org/gmane.comp.version-control.git/109783
j.
git-send-email.perl | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl index cde294c..cef32da 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -959,18 +959,17 @@ foreach my $t (@files) { } elsif (/^From:\s+(.*)$/) { ($author, $author_encoding) = unquote_rfc2047($1); - next if ($suppress_cc{'author'}); + next if $suppress_cc{'author'}; + next if $suppress_cc{'self'} and $author eq $sender; printf("(mbox) Adding cc: %s from line '%s'\n", $1, $_) unless $quiet; push @cc, $1; } elsif (/^Cc:\s+(.*)$/) { + next if $suppress_cc{'cc'}; foreach my $addr (parse_address_line($1)) { - if (unquote_rfc2047($addr) eq $sender) { - next if ($suppress_cc{'self'}); - } else { - next if ($suppress_cc{'cc'}); - } + next if $suppress_cc{'self'} and + unquote_rfc2047($addr) eq $sender; printf("(mbox) Adding cc: %s from line '%s'\n", $addr, $_) unless $quiet; push @cc, $addr; @@ -1038,7 +1037,7 @@ foreach my $t (@files) { or die "(cc-cmd) failed to close pipe to '$cc_cmd'"; } - if (defined $author) { + if (defined $author and $author ne $sender) { $message = "From: $author\n\n$message"; if (defined $author_encoding) { if ($has_content_type) {
-- 1.6.2.rc0.238.g0c1fe