summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2006-07-28 00:42:04 +0000
committerSteve Peters <steve@fisharerojo.org>2006-07-28 00:42:04 +0000
commitad02613cb6d8974aab9c68839c06129c8510c983 (patch)
treeeb381b025d3dc17e6600391647454edd33353d7c /doio.c
parentcccd58310685ffd16595b2773caa8f1346d6b0ee (diff)
downloadperl-ad02613cb6d8974aab9c68839c06129c8510c983.tar.gz
Change stat() and -X filetests so that they treat *FILE{IO}
filehandles like *FILE filehandles. This resolves RT #8244. p4raw-id: //depot/perl@28628
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/doio.c b/doio.c
index 585eb545fb..399cadf3eb 100644
--- a/doio.c
+++ b/doio.c
@@ -1276,6 +1276,7 @@ Perl_my_stat(pTHX)
if (gv == PL_defgv)
return PL_laststatval;
io = GvIO(gv);
+ do_fstat_have_io:
PL_laststype = OP_STAT;
PL_statgv = gv;
sv_setpvn(PL_statname, "", 0);
@@ -1316,6 +1317,10 @@ Perl_my_stat(pTHX)
gv = (GV*)SvRV(sv);
goto do_fstat;
}
+ else if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVIO) {
+ io = (IO*)SvRV(sv);
+ goto do_fstat_have_io;
+ }
s = SvPV_const(sv, len);
PL_statgv = NULL;