summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-03-05 15:35:57 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-05 13:40:31 +0000
commit97e322ff169812aac5db3010a41269f2b1e7fae7 (patch)
tree46dc3b4a31975de97bfa3fa166141ef4ec8aa877 /pp_sys.c
parentdc531b29f28a33eb449c254760d3e2fbf885a3b1 (diff)
downloadperl-97e322ff169812aac5db3010a41269f2b1e7fae7.tar.gz
Re: [ID 20020227.024] unexpected warning getc() on unopened filehandle STDIN
Message-ID: <20020305143557.C695@rafael> p4raw-id: //depot/perl@15044
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index e44ab1c76f..87231ee990 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1158,7 +1158,8 @@ PP(pp_getc)
RETURN;
}
if (!gv || do_eof(gv)) { /* make sure we have fp with something */
- if (ckWARN2(WARN_UNOPENED,WARN_CLOSED) && IoTYPE(io) != IoTYPE_WRONLY)
+ if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)
+ && (!io || (!IoIFP(io) && IoTYPE(io) != IoTYPE_WRONLY)))
report_evil_fh(gv, io, PL_op->op_type);
RETPUSHUNDEF;
}