diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-09-08 18:03:02 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-09-08 18:03:47 -0700 |
commit | 935647290357b277a54366c3caf2ddc89bfbd3eb (patch) | |
tree | f7a8e1824ccf51a775c703fc284e3d502ab18a02 /pp_sys.c | |
parent | 8d4393cf0f53c9e46fd1338d29417f254bd6d1cd (diff) | |
download | perl-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } } |