summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-09-08 18:03:02 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-09-08 18:03:47 -0700
commit935647290357b277a54366c3caf2ddc89bfbd3eb (patch)
treef7a8e1824ccf51a775c703fc284e3d502ab18a02 /pp_sys.c
parent8d4393cf0f53c9e46fd1338d29417f254bd6d1cd (diff)
downloadperl-935647290357b277a54366c3caf2ddc89bfbd3eb.tar.gz
ch(dir|mod|own) should not ignore get-magic on glob(ref)s
When the chdir(*handle) feature was added in 5.8.8, the fact that globs and refs could be magical was not taken into account. They can easily be magical if a typeglob or reference is returned from or assigned to a tied variable.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index ccc4325889..8666a91d13 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3466,14 +3466,14 @@ PP(pp_chdir)
if (PL_op->op_flags & OPf_SPECIAL) {
gv = gv_fetchsv(sv, 0, SVt_PVIO);
}
- else if (isGV_with_GP(sv)) {
+ else if (SvGETMAGIC(sv), isGV_with_GP(sv)) {
gv = MUTABLE_GV(sv);
}
else if (SvROK(sv) && isGV_with_GP(SvRV(sv))) {
gv = MUTABLE_GV(SvRV(sv));
}
else {
- tmps = SvPV_nolen_const(sv);
+ tmps = SvPV_nomg_const_nolen(sv);
}
}