mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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
This commit is contained in:
parent
980dd7c011
commit
b51e5d8b8d
@ -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")) {
|
||||
|
Loading…
Reference in New Issue
Block a user