diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2020-03-23 04:46:24 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2020-08-08 06:11:00 +0000 |
commit | a2a0293d4f1f488e92b11db7b85f28f294384131 (patch) | |
tree | 7e52b217e91a2bd564cc34bd4d054669717d5c11 /Src | |
parent | d4da2c73f0a1767d6562e735ede40251f9f4366b (diff) | |
download | zsh-a2a0293d4f1f488e92b11db7b85f28f294384131.tar.gz zsh-a2a0293d4f1f488e92b11db7b85f28f294384131.tar.xz zsh-a2a0293d4f1f488e92b11db7b85f28f294384131.zip |
47296 (+ unposted additional tests and comments): 'repeat' loops: Let the repeat count use $?.
It's an arithmetic expression.
Diffstat (limited to 'Src')
-rw-r--r-- | Src/loop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/loop.c b/Src/loop.c index f13c8c4a9..41b2e5627 100644 --- a/Src/loop.c +++ b/Src/loop.c @@ -497,7 +497,6 @@ execrepeat(Estate state, UNUSED(int do_exec)) end = state->pc + WC_REPEAT_SKIP(code); - lastval = 0; tmp = ecgetstr(state, EC_DUPTOK, &htok); if (htok) { singsub(&tmp); @@ -506,6 +505,7 @@ execrepeat(Estate state, UNUSED(int do_exec)) count = mathevali(tmp); if (errflag) return 1; + lastval = 0; /* used when the repeat count is zero */ pushheap(); cmdpush(CS_REPEAT); loops++; |