Re: [exmh-workers] Second release candidate for nmh 1.5 is now available

Ken Hornstein <[email protected]> Mon, 14 May 2012 21:41:21 -0400
Newsgroups gmane.mail.nmh.devel,gmane.mail.exmh.devel,gmane.mail.exmh.user
Message-ID <[email protected]>
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <[email protected]>

>$_ is a special global, you lexicalize these with local not my,
>especially if you want to be backwards compatible ;-)
>
>Although 5.8 is a bit old, it's still common and has good Unicode
>support, therefore as long as the changes to support are minimal
>I suggest it is well worth doing.

Sounds good to me ... if that's all it takes to make it work, then
that's easy.  But I think to be more correct those lines should
really be:

	local $_ = shift;
	my $boundary = shift;

Right?

Actually ... looking at that subroutine, I realize that I don't even need
to use $_ at all.  That's left over from a version where I tried to use
a regex operator for line matching, and I guess I get what I deserve
trying to be clever.  How about this patch?

--Ken

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <[email protected]>
Content-Description: replyfilter patch

diff --git a/docs/contrib/replyfilter b/docs/contrib/replyfilter
index 2e98794..8e591bd 100755
--- a/docs/contrib/replyfilter
+++ b/docs/contrib/replyfilter
@@ -661,15 +661,15 @@ sub null_decoder ($)
 
 sub match_boundary($$)
 {
-	my ($_, $boundary) = @_;
+	my ($line, $boundary) = @_;
 
 	return if ! defined $boundary;
 
-	if (substr($_, 0, 2) eq '--') {
-		s/[ \t\r\n]+\Z//;
-		if ($_ eq "--$boundary") {
+	if (substr($line, 0, 2) eq '--') {
+		$line =~ s/[ \t\r\n]+\Z//;
+		if ($line eq "--$boundary") {
 			return 'EOP';
-		} elsif ($_ eq "--$boundary--") {
+		} elsif ($line eq "--$boundary--") {
 			return 'EOM';
 		}
 	}

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Nmh-workers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/nmh-workers

------- =_aaaaaaaaaa0--