diff options
| author | Bart Schaefer <schaefer@ipost.com> | 2021-05-15 13:51:39 -0700 |
|---|---|---|
| committer | Bart Schaefer <schaefer@ipost.com> | 2021-05-15 13:51:39 -0700 |
| commit | e4bd6dc8182d7aa1c28058450db08e0a4dd41e90 (patch) | |
| tree | 9037b64c700715632e8b08b91f4f1a44b5d9f7ec /Src | |
| parent | 48560: add new test file missed on original commit (diff) | |
| download | zsh-e4bd6dc8182d7aa1c28058450db08e0a4dd41e90.tar zsh-e4bd6dc8182d7aa1c28058450db08e0a4dd41e90.tar.gz zsh-e4bd6dc8182d7aa1c28058450db08e0a4dd41e90.tar.bz2 zsh-e4bd6dc8182d7aa1c28058450db08e0a4dd41e90.tar.lz zsh-e4bd6dc8182d7aa1c28058450db08e0a4dd41e90.tar.xz zsh-e4bd6dc8182d7aa1c28058450db08e0a4dd41e90.tar.zst zsh-e4bd6dc8182d7aa1c28058450db08e0a4dd41e90.zip | |
users/26736: avoid infinite loop in getbyte from exit hook
Diffstat (limited to 'Src')
| -rw-r--r-- | Src/Zle/zle_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 0561c3b3b..9edf30e01 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -906,6 +906,8 @@ getbyte(long do_keytmout, int *timeout, int full) continue; stopmsg = 1; zexit(1, ZEXIT_NORMAL); + /* If called from an exit hook, zexit() returns, so: */ + break; } icnt = 0; if (errno == EINTR) { @@ -929,6 +931,8 @@ getbyte(long do_keytmout, int *timeout, int full) zerr("error on TTY read: %e", errno); stopmsg = 1; zexit(1, ZEXIT_NORMAL); + /* If called from an exit hook, zexit() returns, so: */ + break; } } if (cc == '\r') /* undo the exchange of \n and \r determined by */ |
