summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2000-10-19 00:25:58 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2000-10-18 23:36:24 +0000
commit790090df87a94d63cdbf866bce162581c29c2abf (patch)
tree7d03d55c31794f3ab5ccb6e9fd7ce500ddb28e2f /pp_ctl.c
parent177e2d42271d33bb6d33298a0190fe4d19a3bb61 (diff)
downloadperl-790090df87a94d63cdbf866bce162581c29c2abf.tar.gz
Re: [ID 20001018.008] flip-flop bug when there's no <FH>
Message-Id: <200010182225.XAA20330@crypt.compulink.co.uk> p4raw-id: //depot/perl@7365
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index d69aaa8a96..cf2000e5c6 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1005,10 +1005,17 @@ PP(pp_flip)
else {
dTOPss;
SV *targ = PAD_SV(PL_op->op_targ);
-
- if ((PL_op->op_private & OPpFLIP_LINENUM)
- ? (PL_last_in_gv && SvIV(sv) == (IV)IoLINES(GvIOp(PL_last_in_gv)))
- : SvTRUE(sv) ) {
+ int flip;
+
+ if (PL_op->op_private & OPpFLIP_LINENUM) {
+ struct io *gp_io;
+ flip = PL_last_in_gv
+ && (gp_io = GvIOp(PL_last_in_gv))
+ && SvIV(sv) == (IV)IoLINES(gp_io);
+ } else {
+ flip = SvTRUE(sv);
+ }
+ if (flip) {
sv_setiv(PAD_SV(cUNOP->op_first->op_targ), 1);
if (PL_op->op_flags & OPf_SPECIAL) {
sv_setiv(targ, 1);