diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2016-11-05 18:23:04 -0700 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2016-11-05 18:23:04 -0700 |
commit | ff365909105cc360f4d1384bd7ad56cdd97fec31 (patch) | |
tree | 68d80b08344697d4eb7dd85057add16bc860f429 /Src | |
parent | 2c56c7e5e809476fc6511a9e634d2a977593ef9e (diff) | |
download | zsh-ff365909105cc360f4d1384bd7ad56cdd97fec31.tar.gz zsh-ff365909105cc360f4d1384bd7ad56cdd97fec31.tar.xz zsh-ff365909105cc360f4d1384bd7ad56cdd97fec31.zip |
39844: fix "while" condition as per 39839 (commit 2c56c7e5)
Diffstat (limited to 'Src')
-rw-r--r-- | Src/loop.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Src/loop.c b/Src/loop.c index f65c72bf4..367c0df5c 100644 --- a/Src/loop.c +++ b/Src/loop.c @@ -439,13 +439,12 @@ execwhile(Estate state, UNUSED(int do_exec)) if (!((lastval == 0) ^ isuntil)) { if (breaks) breaks--; - lastval = oldval; + if (!retflag) + lastval = oldval; break; } - if (retflag) { - lastval = oldval; + if (retflag) break; - } /* In case the loop body is also a functional no-op, * make sure signal handlers recognize ^C as above. */ |