On Wed, 2004-02-11 at 17:02 -0800, Stas Bekman wrote:
Doesn't save_item completely copy the original sv away and then restore it on the scope exit? For some reason it doesn't work (fails with 'insecure dependency on eval' error).
Index: src/modules/perl/modperl_cmd.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v retrieving revision 1.54 diff -u -r1.54 modperl_cmd.c --- src/modules/perl/modperl_cmd.c 9 Feb 2004 18:18:16 -0000 1.54 +++ src/modules/perl/modperl_cmd.c 11 Feb 2004 23:43:49 -0000 @@ -497,19 +497,12 @@ dollar_zero = get_sv("0", TRUE); dollar_zero_tainted = SvTAINTED(dollar_zero);
- if (dollar_zero_tainted) { - SvTAINTED_off(dollar_zero); - } - ENTER; save_item(dollar_zero); + SvTAINTED_off(dollar_zero); sv_setpv(dollar_zero, directive->filename); eval_pv(arg, FALSE); LEAVE; - - if (dollar_zero_tainted) { - SvTAINTED_on(dollar_zero); - }
Any idea, why?
No, not really. When I originally wrote that piece of code, I was trying to get it to work using save_item() only, and had to packpedal and revert to this nastiness about dollar_zero_tainted..
As far as I can tell, save_item should work in that case.
That sounds like a perl bug to me. I may give it another try later.
The following patch refactors perldo, mainly moving the short-scoped vars like handler_name to be declared in the scope they are used. In which case you don't need to init most of them, and it makes the code more readable, IMHO.
Yes, I also think it makes this fairly large piece of code more readable.
Visually inspected and looks good to me (+1)
Thanks Philippe, now committed.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
