diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-09-10 06:17:53 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-09-10 06:43:49 -0700 |
commit | 2ea1cce77902231565b9c624151dbab02ef92821 (patch) | |
tree | 0f31423d73a32896382fdf6efdd5ecd2d7046e5e /doio.c | |
parent | 557fbd17eba6e0db6dab333c82d35234963af435 (diff) | |
download | perl-2ea1cce77902231565b9c624151dbab02ef92821.tar.gz |
ch(dir|mod|own) should also call FETCH on refs to tied globs
Following on from commit 935647290357b277, which corrected the beha-
viour for tied globs, this commit corrects the behaviour for refer-
ences to tied globs.
(With tests by Nicholas Clark.)
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 18 |
1 files changed, 2 insertions, 16 deletions
@@ -1619,10 +1619,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp) tot = sp - mark; while (++mark <= sp) { GV* gv; - SvGETMAGIC(*mark); - if (isGV_with_GP(*mark)) { - gv = MUTABLE_GV(*mark); - do_fchmod: + if ((gv = MAYBE_DEREF_GV(*mark))) { if (GvIO(gv) && IoIFP(GvIOp(gv))) { #ifdef HAS_FCHMOD APPLY_TAINT_PROPER(); @@ -1636,10 +1633,6 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp) tot--; } } - else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) { - gv = MUTABLE_GV(SvRV(*mark)); - goto do_fchmod; - } else { const char *name = SvPV_nomg_const_nolen(*mark); APPLY_TAINT_PROPER(); @@ -1660,10 +1653,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp) tot = sp - mark; while (++mark <= sp) { GV* gv; - SvGETMAGIC(*mark); - if (isGV_with_GP(*mark)) { - gv = MUTABLE_GV(*mark); - do_fchown: + if ((gv = MAYBE_DEREF_GV(*mark))) { if (GvIO(gv) && IoIFP(GvIOp(gv))) { #ifdef HAS_FCHOWN APPLY_TAINT_PROPER(); @@ -1677,10 +1667,6 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp) tot--; } } - else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) { - gv = MUTABLE_GV(SvRV(*mark)); - goto do_fchown; - } else { const char *name = SvPV_nomg_const_nolen(*mark); APPLY_TAINT_PROPER(); |