From: Jarkko Hietaniemi Date: Mon, 14 May 2001 15:20:58 +0000 (+0000) Subject: Integrate change #10100 from maintperl. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=357c88086d7fbc4a100250293365f8373201add6;p=p5sagit%2Fp5-mst-13.2.git Integrate change #10100 from maintperl. PL_last_in_gv may not be a GV if it was a stale filehandle (fix for bug ID 20010514.027) p4raw-link: @10100 on //depot/maint-5.6/perl: 5244397c028305e17ca4ad7e80cf900323dbeb8b p4raw-id: //depot/perl@10103 p4raw-integrated: from //depot/maint-5.6/perl@10102 'merge in' mg.c (@9288..) pp_ctl.c (@9584..) --- diff --git a/mg.c b/mg.c index 931b1a1..de687c4 100644 --- a/mg.c +++ b/mg.c @@ -674,7 +674,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) case '.': #ifndef lint if (GvIO(PL_last_in_gv)) { - sv_setiv(sv, (IV)IoLINES(GvIO(PL_last_in_gv))); + sv_setiv(sv, (IV)IoLINES(GvIOp(PL_last_in_gv))); } #endif break; diff --git a/pp_ctl.c b/pp_ctl.c index 3cda644..0f034ee 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1079,7 +1079,7 @@ PP(pp_flip) if (PL_op->op_private & OPpFLIP_LINENUM) { struct io *gp_io; flip = PL_last_in_gv - && (gp_io = GvIOp(PL_last_in_gv)) + && (gp_io = GvIO(PL_last_in_gv)) && SvIV(sv) == (IV)IoLINES(gp_io); } else { flip = SvTRUE(sv); @@ -1160,7 +1160,8 @@ PP(pp_flop) SV *targ = PAD_SV(cUNOP->op_first->op_targ); sv_inc(targ); if ((PL_op->op_private & OPpFLIP_LINENUM) - ? (PL_last_in_gv && SvIV(sv) == (IV)IoLINES(GvIOp(PL_last_in_gv))) + ? (GvIO(PL_last_in_gv) + && SvIV(sv) == (IV)IoLINES(GvIOp(PL_last_in_gv))) : SvTRUE(sv) ) { sv_setiv(PAD_SV(((UNOP*)cUNOP->op_first)->op_first->op_targ), 0); sv_catpv(targ, "E0");