Skip to content

Commit

Permalink
Fix break from remove-each
Browse files Browse the repository at this point in the history
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]

Fix CC#2192
  • Loading branch information
zsx committed Jan 27, 2015
1 parent 63115b1 commit b336459
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/n-loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,10 @@
ds = Do_Blk(body, 0);

if (THROWN(ds)) {
if ((err = Check_Error(ds)) >= 0) break;
if ((err = Check_Error(ds)) >= 0) {
index = rindex;
break;
}
// else CONTINUE:
if (mode == 1) SET_FALSE(ds); // keep the value (for mode == 1)
} else {
Expand Down

0 comments on commit b336459

Please sign in to comment.