summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-07-06 18:45:35 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-07-06 18:45:35 +0000
commit9bc648147f297cac824aecca53c6e0232b54c002 (patch)
tree4d931e8c49e7a461b17637256a2ff96b9a24455b /pp_sys.c
parent77808da1249dc49b6d1ea4171ebce9989b18ea3f (diff)
downloadperl-9bc648147f297cac824aecca53c6e0232b54c002.tar.gz
per Larry suggestion, toss change#1327 and fix the documentation
to match behavior instead p4raw-link: @1327 on //depot/perl: 0ce625782f64de805c21893bca308710ed297c68 p4raw-id: //depot/perl@1338
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/pp_sys.c b/pp_sys.c
index a7e8dd5b3b..6a4ad31eb5 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -889,7 +889,6 @@ PP(pp_getc)
djSP; dTARGET;
GV *gv;
MAGIC *mg;
- PerlIO *fp;
if (MAXARG <= 0)
gv = stdingv;
@@ -911,19 +910,11 @@ PP(pp_getc)
SvSetMagicSV_nosteal(TARG, TOPs);
RETURN;
}
- if (!gv || !GvIO(gv) || !(fp = IoIFP(GvIOp(gv)))) /* valid fp? */
+ if (!gv || do_eof(gv)) /* make sure we have fp with something */
RETPUSHUNDEF;
-
- if (do_eof(gv)) { /* handle magic argv, if needed */
- if (PerlIO_error(fp))
- PUSHs(&sv_undef);
- else
- PUSHp("",0);
- RETURN;
- }
TAINT;
sv_setpv(TARG, " ");
- *SvPVX(TARG) = PerlIO_getc(fp); /* should never be EOF */
+ *SvPVX(TARG) = PerlIO_getc(IoIFP(GvIOp(gv))); /* should never be EOF */
PUSHTARG;
RETURN;
}