From 09e8efccba1f47d53c182ecd6161dfcbbbc53b0f Mon Sep 17 00:00:00 2001 From: Nick Ing-Simmons Date: Sun, 25 Mar 2001 22:15:02 +0000 Subject: Fix readline in list mode to tell rest of world that it has things on the stack. Otherwise if perl code gets invoked underneath it it scribbles over results-so-far. (Why TIEHANDLE has not tripped on this is a mystery.) p4raw-id: //depot/perlio@9351 --- pp_hot.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pp_hot.c') diff --git a/pp_hot.c b/pp_hot.c index 58874a87b9..7a6ad3224d 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1511,6 +1511,7 @@ Perl_do_readline(pTHX) || (IoFLAGS(io) & IOf_NOLINE) || !RsSNARF(rs)) for (;;) { + PUTBACK; if (!sv_gets(sv, fp, offset) && (type == OP_GLOB || SNARF_EOF(gimme, PL_rs, io, sv))) { @@ -1531,6 +1532,7 @@ Perl_do_readline(pTHX) } if (gimme == G_SCALAR) { (void)SvOK_off(TARG); + SPAGAIN; PUSHTARG; } MAYBE_TAINT_LINE(io, sv); @@ -1540,6 +1542,7 @@ Perl_do_readline(pTHX) IoLINES(io)++; IoFLAGS(io) |= IOf_NOLINE; SvSETMAGIC(sv); + SPAGAIN; XPUSHs(sv); if (type == OP_GLOB) { char *tmps; -- cgit v1.2.1