From ff365909105cc360f4d1384bd7ad56cdd97fec31 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 5 Nov 2016 18:23:04 -0700 Subject: 39844: fix "while" condition as per 39839 (commit 2c56c7e5) --- Src/loop.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Src/loop.c') 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. */ -- cgit v1.2.3