mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-23 01:31:27 +01:00
users/26742: break out of surrounding shell loops when exit is called from an exit hook
This commit is contained in:
parent
e4bd6dc818
commit
db36149006
2 changed files with 7 additions and 1 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
2021-05-15 Bart Schaefer <schaefer@zsh.org>
|
2021-05-15 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* Peter Stephenson: users/26742: Src/builtin.c: break out of
|
||||||
|
surrounding shell loops when "exit" is called from an exit hook
|
||||||
|
|
||||||
* users/26736: Src/Zle/zle_main.c: avoid infinite loop in getbyte
|
* users/26736: Src/Zle/zle_main.c: avoid infinite loop in getbyte
|
||||||
when read -q is called from exit hook
|
when read -q is called from exit hook
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5828,8 +5828,11 @@ zexit(int val, enum zexit_t from_where)
|
||||||
* a later value always overrides an earlier.
|
* a later value always overrides an earlier.
|
||||||
*/
|
*/
|
||||||
exit_val = val;
|
exit_val = val;
|
||||||
if (shell_exiting == -1)
|
if (shell_exiting == -1) {
|
||||||
|
retflag = 1;
|
||||||
|
breaks = loops;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset(MONITOR) && !stopmsg && from_where != ZEXIT_SIGNAL) {
|
if (isset(MONITOR) && !stopmsg && from_where != ZEXIT_SIGNAL) {
|
||||||
scanjobs(); /* check if jobs need printing */
|
scanjobs(); /* check if jobs need printing */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue