summary refs log tree commit diff
path: root/Src/loop.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2014-04-20 11:09:51 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2014-04-20 11:09:51 -0700
commit9da59238ff3163de41800c82d6304b9a09307fcf (patch)
tree8f17de1268ad0081dd213f1841cce2ee63c45623 /Src/loop.c
parent848badaa5f0a18ca3388016d49ffc340b6c2d0c6 (diff)
downloadzsh-9da59238ff3163de41800c82d6304b9a09307fcf.tar.gz
zsh-9da59238ff3163de41800c82d6304b9a09307fcf.tar.xz
zsh-9da59238ff3163de41800c82d6304b9a09307fcf.zip
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.
Diffstat (limited to 'Src/loop.c')
-rw-r--r--Src/loop.c6
1 files changed, 3 insertions, 3 deletions
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);