tui.c: Handle missing "key_dc" terminfo entry (#6128)

Closes #6025
This commit is contained in:
svaante 2017-02-16 11:59:01 +01:00 committed by Justin M. Keyes
parent 0e44916fff
commit a05690ae2d

View File

@ -1014,7 +1014,7 @@ static const char *tui_tk_ti_getstr(const char *name, const char *value,
} else if (strcmp(name, "key_dc") == 0) {
ILOG("libtermkey:kdch1=%s", value);
// Vim: "If <BS> and <DEL> are now the same, redefine <DEL>."
if (stty_erase != NULL && strcmp(stty_erase, value) == 0) {
if (stty_erase != NULL && value != NULL && strcmp(stty_erase, value) == 0) {
return stty_erase[0] == DEL ? (char *)CTRL_H_STR : (char *)DEL_STR;
}
}