36707: distinguish ERR_RETURN value of retflag so that execif() can ignore it in the test sublist

This commit is contained in:
Barton E. Schaefer 2015-09-30 20:01:13 -07:00
parent d1a810b000
commit 2bf4f667fb
3 changed files with 10 additions and 3 deletions

View file

@ -10,6 +10,9 @@
2015-09-30 Barton E. Schaefer <schaefer@zsh.org>
* 36707: Src/exec.c, Src/loop.c: distinguish ERR_RETURN value
of retflag so that execif() can ignore it in the test sublist
* cf. 36690: Doc/Zsh/builtins.yo: remove sentence fragment
2015-09-30 Daniel Shahaf <d.s@daniel.shahaf.name>

View file

@ -1408,7 +1408,7 @@ sublist_done:
exit(lastval);
}
if (errreturn) {
retflag = 1;
retflag = 2;
breaks = loops;
}
}

View file

@ -552,8 +552,12 @@ execif(Estate state, int do_exec)
run = 1;
break;
}
if (retflag)
break;
if (retflag) {
if (retflag == 2)
retflag = 0; /* Never ERR_RETURN here */
else
break;
}
s = 1;
state->pc = next;
}