From 9da59238ff3163de41800c82d6304b9a09307fcf Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sun, 20 Apr 2014 11:09:51 -0700 Subject: 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. --- Src/loop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Src') diff --git a/Src/loop.c b/Src/loop.c index dc8f2320f..2f639fd5a 100644 --- a/Src/loop.c +++ b/Src/loop.c @@ -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); -- cgit 1.4.1