stas 2004/02/13 20:25:01
Modified: src/modules/perl modperl_cmd.c
Log:
provide a cleaner solution for implementing 'local $0'
Revision Changes Path
1.57 +3 -14 modperl-2.0/src/modules/perl/modperl_cmd.c
Index: modperl_cmd.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -u -r1.56 -r1.57
--- modperl_cmd.c 12 Feb 2004 22:02:44 -0000 1.56
+++ modperl_cmd.c 14 Feb 2004 04:25:01 -0000 1.57
@@ -516,23 +516,12 @@
}
{
- /* Set $0 to the current configuration file */
- SV *dollar_zero = get_sv("0", TRUE);
- int dollar_zero_tainted = SvTAINTED(dollar_zero);
-
- if (dollar_zero_tainted) {
- SvTAINTED_off(dollar_zero);
- }
-
+ GV *gv = gv_fetchpv("0", TRUE, SVt_PV);
ENTER;
- save_item(dollar_zero);
- sv_setpv(dollar_zero, directive->filename);
+ save_scalar(gv); /* local $0 */
+ sv_setpv_mg(GvSV(gv), directive->filename);
eval_pv(arg, FALSE);
LEAVE;
-
- if (dollar_zero_tainted) {
- SvTAINTED_on(dollar_zero);
- }
}
if (SvTRUE(ERRSV)) {