diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-03-25 22:15:02 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-03-25 22:15:02 +0000 |
commit | 09e8efccba1f47d53c182ecd6161dfcbbbc53b0f (patch) | |
tree | c8f0f8ed410f925b822439ee6c3cc69aaf4c7b20 /pp_hot.c | |
parent | 2590d28705872a65d11745576d64aa79a6c9cdfe (diff) | |
download | perl-09e8efccba1f47d53c182ecd6161dfcbbbc53b0f.tar.gz |
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
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |