Change 18269 by [EMAIL PROTECTED] on 2002/12/09 00:19:33
Subject: Re: Bug in Filter::Simple
From: Slaven Rezic <[EMAIL PROTECTED]>
Date: 07 Nov 2002 10:01:41 +0100
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
.... //depot/perl/ext/Filter/Util/Call/Call.xs#6 edit
.... //depot/perl/ext/Filter/t/call.t#4 edit
Differences ...
==== //depot/perl/ext/Filter/Util/Call/Call.xs#6 (text) ====
Index: perl/ext/Filter/Util/Call/Call.xs
--- perl/ext/Filter/Util/Call/Call.xs#5~12972~ Tue Nov 13 05:41:02 2001
+++ perl/ext/Filter/Util/Call/Call.xs Sun Dec 8 16:19:33 2002
@@ -235,7 +235,8 @@
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 ;
==== //depot/perl/ext/Filter/t/call.t#4 (text) ====
Index: perl/ext/Filter/t/call.t
--- perl/ext/Filter/t/call.t#3~11434~ Sat Jul 21 16:12:26 2001
+++ perl/ext/Filter/t/call.t Sun Dec 8 16:19:33 2002
@@ -15,7 +15,7 @@
use vars qw($Inc $Perl);
-print "1..28\n" ;
+print "1..32\n" ;
$Perl = "$Perl -w" ;
@@ -24,12 +24,14 @@
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 @@
}
+{
+
+# no without use
+# see Message-ID: <[EMAIL PROTECTED]>
+####################
+
+writeFile("${module6}.pm", <<EOM);
+package ${module6} ;
+#use Filter::Simple;
+#FILTER {}
+use Filter::Util::Call;
+sub import { filter_add(sub{}) }
+sub unimport { filter_del() }
+1;
+EOM
+
+writeFile($filename2, <<EOM);
+no ${module6} ;
+print "ok";
+EOM
+
+my $a = `$Perl "-I." $Inc -e "no ${module6}; print q{ok}"`;
+ok(29, ($? >>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" ;
}
End of Patch.