summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Cozens <simon@netthink.co.uk>2000-12-17 12:31:56 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-17 17:39:35 +0000
commit50f846a78cb1380a050b0b517546043c11cbd578 (patch)
treeb2768b13ca1602e660a969cfac4d8b17d6f820f5
parent4d69506c2d1d71db8d32dc38aa9aa6beb5cd8d07 (diff)
downloadperl-50f846a78cb1380a050b0b517546043c11cbd578.tar.gz
Re: The long awaited feature ...
Message-ID: <20001217123156.A3891@deep-dark-truthful-mirror.perlhacker.org> Add a warning to binmode() about using bad filehandles (can happen e.g. if someone forgets the filehandle argument) p4raw-id: //depot/perl@8145
-rw-r--r--pp_sys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 7d6386e3f0..0c834ca60e 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -709,8 +709,10 @@ PP(pp_binmode)
}
EXTEND(SP, 1);
- if (!(io = GvIO(gv)) || !(fp = IoIFP(io)))
- RETPUSHUNDEF;
+ if (!(io = GvIO(gv)) || !(fp = IoIFP(io))) {
+ report_evil_fh(gv, io, PL_op->op_type);
+ RETPUSHUNDEF;
+ }
if (discp) {
names = SvPV(discp,len);