diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-02-15 00:58:00 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-14 21:56:52 +0000 |
commit | 90133b69afb5dccc00b1483d3839904e458ba347 (patch) | |
tree | a10c3e20b651b46dfff6c979918995f7e0f074cb /pp_sys.c | |
parent | cd16c24cb16bb0bd0fa486b8e98c39fcf6ebcf5c (diff) | |
download | perl-90133b69afb5dccc00b1483d3839904e458ba347.tar.gz |
Re: bug? no warning from getc BOLLOCKS
Message-ID: <20020214235800.A12901@rafael>
p4raw-id: //depot/perl@14695
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1134,7 +1134,7 @@ PP(pp_getc) { dSP; dTARGET; GV *gv; - IO *io; + IO *io = NULL; MAGIC *mg; if (MAXARG == 0) @@ -1157,8 +1157,11 @@ PP(pp_getc) SvSetMagicSV_nosteal(TARG, TOPs); RETURN; } - if (!gv || do_eof(gv)) /* make sure we have fp with something */ + if (!gv || do_eof(gv)) { /* make sure we have fp with something */ + if (ckWARN2(WARN_UNOPENED,WARN_CLOSED) && IoTYPE(io) != IoTYPE_WRONLY) + report_evil_fh(gv, io, PL_op->op_type); RETPUSHUNDEF; + } TAINT; sv_setpv(TARG, " "); *SvPVX(TARG) = PerlIO_getc(IoIFP(GvIOp(gv))); /* should never be EOF */ |