diff options
author | Steve Peters <steve@fisharerojo.org> | 2006-07-28 00:42:04 +0000 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2006-07-28 00:42:04 +0000 |
commit | ad02613cb6d8974aab9c68839c06129c8510c983 (patch) | |
tree | eb381b025d3dc17e6600391647454edd33353d7c /doio.c | |
parent | cccd58310685ffd16595b2773caa8f1346d6b0ee (diff) | |
download | perl-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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |