diff options
| author | Peter Stephenson <p.stephenson@samsung.com> | 2021-05-15 13:59:17 -0700 |
|---|---|---|
| committer | Bart Schaefer <schaefer@ipost.com> | 2021-05-15 13:59:17 -0700 |
| commit | db3614900602b51edd79ae8c1308b8665de9f913 (patch) | |
| tree | 0cdc7c8235fb7edb289bc651f28d29171c3d68a2 /Src | |
| parent | users/26736: avoid infinite loop in getbyte from exit hook (diff) | |
| download | zsh-db3614900602b51edd79ae8c1308b8665de9f913.tar zsh-db3614900602b51edd79ae8c1308b8665de9f913.tar.gz zsh-db3614900602b51edd79ae8c1308b8665de9f913.tar.bz2 zsh-db3614900602b51edd79ae8c1308b8665de9f913.tar.lz zsh-db3614900602b51edd79ae8c1308b8665de9f913.tar.xz zsh-db3614900602b51edd79ae8c1308b8665de9f913.tar.zst zsh-db3614900602b51edd79ae8c1308b8665de9f913.zip | |
users/26742: break out of surrounding shell loops when exit is called from an exit hook
Diffstat (limited to 'Src')
| -rw-r--r-- | Src/builtin.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index b7ceefd55..a29eb49e4 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -5828,8 +5828,11 @@ zexit(int val, enum zexit_t from_where) * a later value always overrides an earlier. */ exit_val = val; - if (shell_exiting == -1) + if (shell_exiting == -1) { + retflag = 1; + breaks = loops; return; + } if (isset(MONITOR) && !stopmsg && from_where != ZEXIT_SIGNAL) { scanjobs(); /* check if jobs need printing */ |
