diff options
author | Boskovits <boskovits@gmail.com> | 2019-03-07 11:42:58 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-03-07 11:42:58 +0100 |
commit | b51e5d8b8dd2b5e7c5986f19bdf4130226b47379 (patch) | |
tree | af45ad560e37e945b7395c57034da5de00510518 | |
parent | 980dd7c011f66eccc83662027c3f6dcd23a40cb4 (diff) | |
download | rneovim-b51e5d8b8dd2b5e7c5986f19bdf4130226b47379.tar.gz rneovim-b51e5d8b8dd2b5e7c5986f19bdf4130226b47379.tar.bz2 rneovim-b51e5d8b8dd2b5e7c5986f19bdf4130226b47379.zip |
tui_tk_ti_getstr: handle weird value #9688
tigetstr (used by libtermkey/driver-ti.c) may return -1 as a pointer.
Documented in man 3 tigetstr. https://linux.die.net/man/3/tigetstr
> The tigetstr routine returns the value (char *)-1 if capname is not a string
> capability, or 0 if it is canceled or absent from the terminal description.
Fixed #9687
-rw-r--r-- | src/nvim/tui/tui.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index e20cf15a79..3e7a3b1ba1 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -2000,7 +2000,7 @@ static const char *tui_tk_ti_getstr(const char *name, const char *value, } else if (strequal(name, "key_dc")) { DLOG("libtermkey:kdch1=%s", value); // Vim: "If <BS> and <DEL> are now the same, redefine <DEL>." - if (value != NULL && strequal(stty_erase, value)) { + if (value != NULL && value != (char *)-1 && strequal(stty_erase, value)) { return stty_erase[0] == DEL ? CTRL_H_STR : DEL_STR; } } else if (strequal(name, "key_mouse")) { |