summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-13 16:52:23 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-13 21:24:55 -0800
commitbd5f6c0160a24cc91f91e8fe5180efde0d7fb8af (patch)
tree8f818c8bff7eebdd5177b970a510477fa8972155 /pp_sys.c
parent020cc77c5665898032456aabfe6ae45ccf11f874 (diff)
downloadperl-bd5f6c0160a24cc91f91e8fe5180efde0d7fb8af.tar.gz
stat $ioref should record the handle for -T _
stat $gv records the handle so that -T _ can use it. But stat $ioref hasn’t been doing that, until this commit. PL_statgv can now hold an SVt_PVIO instead of a SVt_PVGV.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 430aa7cce0..1ee14d7eb5 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2803,6 +2803,8 @@ PP(pp_stat)
if (PL_op->op_type == OP_LSTAT)
goto do_fstat_warning_check;
PL_laststype = OP_STAT;
+ PL_statgv = (GV *)io;
+ sv_setpvs(PL_statname, "");
goto do_fstat_have_io;
}
@@ -3313,7 +3315,9 @@ PP(pp_fttext)
EXTEND(SP, 1);
if (gv == PL_defgv) {
if (PL_statgv)
- io = GvIO(PL_statgv);
+ io = SvTYPE(PL_statgv) == SVt_PVIO
+ ? (IO *)PL_statgv
+ : GvIO(PL_statgv);
else {
sv = PL_statname;
goto really_filename;