mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 22:11:54 +02:00
32569: lastval ($?) should not be reset between word list substitution and loop body execution in for/select
Remove one other redundant and therefore confusing assignment to lastval.
This commit is contained in:
parent
848badaa5f
commit
9da59238ff
2 changed files with 6 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
|||
2014-04-20 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 32569: Src/loop.c: lastval ($?) should not be reset between
|
||||
word list substitution and loop body execution in for/select.
|
||||
|
||||
* 32568: Src/exec.c, Src/loop.c: consistency in handling of errflag
|
||||
condition during substitutions in for/select word lists, function
|
||||
definition name position, and anonymous function argument lists.
|
||||
|
|
|
@ -73,7 +73,7 @@ execfor(Estate state, int do_exec)
|
|||
matheval(str);
|
||||
if (errflag) {
|
||||
state->pc = end;
|
||||
return lastval = errflag;
|
||||
return 1;
|
||||
}
|
||||
cond = ecgetstr(state, EC_NODUP, &ctok);
|
||||
advance = ecgetstr(state, EC_NODUP, &atok);
|
||||
|
@ -102,7 +102,7 @@ execfor(Estate state, int do_exec)
|
|||
addlinknode(args, dupstring(*x));
|
||||
}
|
||||
}
|
||||
lastval = 0;
|
||||
/* lastval = 0; */
|
||||
loops++;
|
||||
pushheap();
|
||||
cmdpush(CS_FOR);
|
||||
|
@ -241,7 +241,7 @@ execselect(Estate state, UNUSED(int do_exec))
|
|||
return 1;
|
||||
}
|
||||
loops++;
|
||||
lastval = 0;
|
||||
/* lastval = 0; */
|
||||
pushheap();
|
||||
cmdpush(CS_SELECT);
|
||||
usezle = interact && SHTTY != -1 && isset(USEZLE);
|
||||
|
|
Loading…
Reference in a new issue