Skip to content

Commit 9a9b195

Browse files
committed
ATRONIX/FIX: Fix break from remove-each
Reported by MichaT from altme. This is what the actual result: >> remove-each n s: [ 1 2 3 4] [ print n if n = 2 [ break] true ] s 1 2 == [3 4] This is what's expected: >> remove-each n s: [ 1 2 3 4] [ print n if n = 2 [ break] true ] s 1 2 == [2 3 4] Fixes: metaeducation/rebol-issues#2192 (cherry picked from commit b336459)
1 parent e41a254 commit 9a9b195

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/n-loop.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,10 @@
419419
ds = Do_Blk(body, 0);
420420

421421
if (THROWN(ds)) {
422-
if ((err = Check_Error(ds)) >= 0) break;
422+
if ((err = Check_Error(ds)) >= 0) {
423+
index = rindex;
424+
break;
425+
}
423426
// else CONTINUE:
424427
if (mode == 1) SET_FALSE(ds); // keep the value (for mode == 1)
425428
} else {

0 commit comments

Comments
 (0)