Skip Menu |
 

This queue is for tickets about the Text-Autoformat CPAN distribution.

Report information
The Basics
Id: 29500
Status: resolved
Priority: 0/
Queue: Text-Autoformat

People
Owner: NEILB [...] cpan.org
Requestors: CDENT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.13
Fixed in: 1.72



Subject: ignore handling fails to work, patch included
About a year ago, Dave Rolsky found and reported a bug in Text::Autoformat that causes ignore to not work correctly. His description: "The problem is the use of "$lastignored &&=". Because of Perl's short-circuiting, the ignore subref is never being called when $lastignored is true. The tests I sent earlier had a bug of their which masked this bug." And his patch: diff -Nru ../Text-Autoformat-1.13/lib/Text/Autoformat.pm ./lib/Text/Autoformat.pm --- ../Text-Autoformat-1.13/lib/Text/Autoformat.pm 2005-05-04 17:44:23.000000000 -0500 +++ ./lib/Text/Autoformat.pm 2006-11-15 11:57:40.000000000 -0600 @@ -273,8 +273,8 @@ my $lastignored = 1; for my $index (0..$#paras) { local $_ = $paras[$index]{raw} . "\n"; - $lastignored &&= - $paras[$index]{ignore} = $args{ignore}($lastignored); + $paras[$index]{ignore} = $args{ignore}($lastignored); + $lastignored &&= $paras[$index]{ignore}; next unless $args{mail} && /^--$/; $remainder = join "\n", map { $_->{raw} } splice @paras, $index; $remainder .= "\n" unless $remainder =~ /\n\z/;
Download (untitled) / with headers
text/plain 103b
This was obviously fixed at some point in the past, since your proposed fix is already in the code :-)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.