summaryrefslogtreecommitdiff
path: root/Src/loop.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
commit31bcc5c263aea983e967426e2b94269e7605dcd4 (patch)
tree7b48ad9d7799afe09b7d7d8adc980bd5db935bdf /Src/loop.c
parent5086b5356abcef8849dc8a09902b7c55f01db3c0 (diff)
parentb09f4483416c54c1782824633dfabaf2ec0265b6 (diff)
downloadzsh-31bcc5c263aea983e967426e2b94269e7605dcd4.tar.gz
zsh-31bcc5c263aea983e967426e2b94269e7605dcd4.zip
Update upstream source from tag 'upstream/5.8.1.2-test'
Update to upstream version '5.8.1.2-test' with Debian dir b380d582bf51cd93149e4dea28fffa1ad85db4f5
Diffstat (limited to 'Src/loop.c')
-rw-r--r--Src/loop.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Src/loop.c b/Src/loop.c
index 01abc6cc9..db5b3e097 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -43,7 +43,7 @@ mod_export int contflag;
/* # of break levels */
/**/
-mod_export int breaks;
+mod_export volatile int breaks;
/**/
int
@@ -497,13 +497,15 @@ execrepeat(Estate state, UNUSED(int do_exec))
end = state->pc + WC_REPEAT_SKIP(code);
- lastval = 0;
tmp = ecgetstr(state, EC_DUPTOK, &htok);
- if (htok)
+ if (htok) {
singsub(&tmp);
+ untokenize(tmp);
+ }
count = mathevali(tmp);
if (errflag)
return 1;
+ lastval = 0; /* used when the repeat count is zero */
pushheap();
cmdpush(CS_REPEAT);
loops++;
@@ -581,7 +583,7 @@ execif(Estate state, int do_exec)
cmdpop();
} else {
noerrexit = olderrexit;
- if (!retflag)
+ if (!retflag && !errflag)
lastval = 0;
}
state->pc = end;
@@ -742,7 +744,7 @@ exectry(Estate state, int do_exec)
/* The :try clause */
++try_tryflag;
- execlist(state, 1, do_exec);
+ execlist(state, 1, 0);
--try_tryflag;
/* Don't record errflag here, may be reset. However, */