From 935647290357b277a54366c3caf2ddc89bfbd3eb Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 8 Sep 2011 18:03:02 -0700 Subject: 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. --- pp_sys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pp_sys.c') 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); } } -- cgit v1.2.1