summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
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) ) {