summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-10-31 20:46:02 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-10-31 20:46:02 +0000
commit18708f5a7334d978ddf7562cb7f58e28bec6e4ed (patch)
treefd546b7856fc3ed473e57722637cfad50805da86 /pp_hot.c
parent539a3d6c530ba5e4a9bb32654bf5f07b038a4434 (diff)
downloadperl-18708f5a7334d978ddf7562cb7f58e28bec6e4ed.tar.gz
make nested ARGV/$^I loops work correctly; fixes several bugs
in the way ARGV state was handled in readline(); writing a subroutine to do inplace edits is now possible, provided *ARGV, *ARGVOUT, $^I and $_ are localized where needed p4raw-id: //depot/perl@4502
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 6f9528a96a..ecaed7bb9a 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1085,9 +1085,9 @@ Perl_do_readline(pTHX)
if (!fp) {
if (IoFLAGS(io) & IOf_ARGV) {
if (IoFLAGS(io) & IOf_START) {
- IoFLAGS(io) &= ~IOf_START;
IoLINES(io) = 0;
if (av_len(GvAVn(PL_last_in_gv)) < 0) {
+ IoFLAGS(io) &= ~IOf_START;
do_open(PL_last_in_gv,"-",1,FALSE,O_RDONLY,0,Nullfp);
sv_setpvn(GvSV(PL_last_in_gv), "-", 1);
SvSETMAGIC(GvSV(PL_last_in_gv));
@@ -1098,7 +1098,6 @@ Perl_do_readline(pTHX)
fp = nextargv(PL_last_in_gv);
if (!fp) { /* Note: fp != IoIFP(io) */
(void)do_close(PL_last_in_gv, FALSE); /* now it does*/
- IoFLAGS(io) |= IOf_START;
}
}
else if (type == OP_GLOB) {
@@ -1296,7 +1295,6 @@ Perl_do_readline(pTHX)
if (fp)
continue;
(void)do_close(PL_last_in_gv, FALSE);
- IoFLAGS(io) |= IOf_START;
}
else if (type == OP_GLOB) {
if (!do_close(PL_last_in_gv, FALSE) && ckWARN(WARN_CLOSED)) {