summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-09-10 06:17:53 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-09-10 06:43:49 -0700
commit2ea1cce77902231565b9c624151dbab02ef92821 (patch)
tree0f31423d73a32896382fdf6efdd5ecd2d7046e5e /pp_sys.c
parent557fbd17eba6e0db6dab333c82d35234963af435 (diff)
downloadperl-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 'pp_sys.c')
-rw-r--r--pp_sys.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/pp_sys.c b/pp_sys.c
index e92d13de8e..50c1a12986 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3466,18 +3466,8 @@ PP(pp_chdir)
if (PL_op->op_flags & OPf_SPECIAL) {
gv = gv_fetchsv(sv, 0, SVt_PVIO);
}
- else {
- SvGETMAGIC(sv);
- if(isGV_with_GP(sv)) {
- gv = MUTABLE_GV(sv);
- }
- else if (SvROK(sv) && isGV_with_GP(SvRV(sv))) {
- gv = MUTABLE_GV(SvRV(sv));
- }
- else {
+ else if (!(gv = MAYBE_DEREF_GV(sv)))
tmps = SvPV_nomg_const_nolen(sv);
- }
- }
}
if( !gv && (!tmps || !*tmps) ) {