From: Slaven Rezic Date: Thu, 7 Nov 2002 10:01:41 +0000 (+0100) Subject: Re: Bug in Filter::Simple X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=57a224e5764ead7e57b81a85c1724954c2c08e39;p=p5sagit%2Fp5-mst-13.2.git Re: Bug in Filter::Simple Message-ID: <87of91u51m.fsf@vran.herceg.de> p4raw-id: //depot/perl@18269 --- diff --git a/ext/Filter/Util/Call/Call.xs b/ext/Filter/Util/Call/Call.xs index 0215fa6..05fe95f 100644 --- a/ext/Filter/Util/Call/Call.xs +++ b/ext/Filter/Util/Call/Call.xs @@ -235,7 +235,8 @@ void filter_del() CODE: dMY_CXT; - FILTER_ACTIVE(FILTER_DATA(IDX)) = FALSE ; + if (PL_rsfp_filters && IDX <= av_len(PL_rsfp_filters) && FILTER_DATA(IDX) && FILTER_ACTIVE(FILTER_DATA(IDX))) + FILTER_ACTIVE(FILTER_DATA(IDX)) = FALSE ; diff --git a/ext/Filter/t/call.t b/ext/Filter/t/call.t index a145ab2..0f9b452 100644 --- a/ext/Filter/t/call.t +++ b/ext/Filter/t/call.t @@ -15,7 +15,7 @@ use warnings; use vars qw($Inc $Perl); -print "1..28\n" ; +print "1..32\n" ; $Perl = "$Perl -w" ; @@ -24,12 +24,14 @@ my $here = getcwd ; my $filename = "call.tst" ; +my $filename2 = "call2.tst" ; my $filenamebin = "call.bin" ; my $module = "MyTest" ; my $module2 = "MyTest2" ; my $module3 = "MyTest3" ; my $module4 = "MyTest4" ; my $module5 = "MyTest5" ; +my $module6 = "MyTest6" ; my $nested = "nested" ; my $block = "block" ; my $redir = $^O eq 'MacOS' ? "" : "2>&1"; @@ -781,14 +783,47 @@ EOM } +{ + +# no without use +# see Message-ID: <20021106212427.A15377@ttul.org> +#################### + +writeFile("${module6}.pm", <>8) == 0); +ok(30, $a eq 'ok'); + +$a = `$Perl "-I." $Inc $filename2`; +ok(31, ($? >>8) == 0); +ok(32, $a eq 'ok'); + +} + END { 1 while unlink $filename ; + 1 while unlink $filename2 ; 1 while unlink $filenamebin ; 1 while unlink "${module}.pm" ; 1 while unlink "${module2}.pm" ; 1 while unlink "${module3}.pm" ; 1 while unlink "${module4}.pm" ; 1 while unlink "${module5}.pm" ; + 1 while unlink "${module6}.pm" ; 1 while unlink $nested ; 1 while unlink "${block}.pm" ; }