From: Junio C Hamano Date: Tue, 20 Sep 2011 19:26:18 GMT Subject: Re: [PATCH] send-email: Honor multi-part email messages Message-ID: <7v1uvb6mn9.fsf@alter.siamese.dyndns.org> In-Reply-To: <1316507347-6693-1-git-send-email-zapped@mail.ru> Alexey Shumkin writes: > diff --git a/git-send-email.perl b/git-send-email.perl > index 98ab33a..1abf4a4 100755 > --- a/git-send-email.perl > +++ b/git-send-email.perl > @@ -1403,12 +1403,17 @@ sub file_has_nonascii { > > sub body_or_subject_has_nonascii { > my $fn = shift; > + my $multipart = 0; > open(my $fh, '<', $fn) > or die "unable to open $fn: $!\n"; > while (my $line = <$fh>) { > last if $line =~ /^$/; > + if ($line =~ /^Content-Type:\s*multipart\/mixed.*$/) { > + $multipart = 1; > + } > return 1 if $line =~ /^Subject.*[^[:ascii:]]/; > } > + return 0 if $multipart; Looks as if you can lose the extra variable and return 0 immediately when you find a line with that Content-Type inside the loop. What am I missing?