• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision4005 (tree)
Time2019-11-11 23:19:28
Authormagicant

Log Message

Ignore empty key sequence in terminfo (#39741)

If an empty key sequence is in le_keycodes, the read_next function would
loop infinitely. Such a sequence should be ignored even if defined in
the terminfo database.

Patch contributed by hvdijk

Change Summary

Incremental Difference

--- yash/trunk/NEWS (revision 4004)
+++ yash/trunk/NEWS (revision 4005)
@@ -8,6 +8,12 @@
88 x: new bug
99
1010 ----------------------------------------------------------------------
11+Yash 2.50
12+
13+ * Line-editing no longer hangs when the terminfo database maps a
14+ key to an empty string.
15+
16+----------------------------------------------------------------------
1117 Yash 2.49
1218
1319 + '--for-local' option.
--- yash/trunk/lineedit/terminfo.c (revision 4004)
+++ yash/trunk/lineedit/terminfo.c (revision 4005)
@@ -545,7 +545,7 @@
545545 }
546546 for (size_t i = 0; i < sizeof keymap / sizeof *keymap; i++) {
547547 const char *seq = tigetstr(keymap[i].capability);
548- if (is_strcap_valid(seq))
548+ if (is_strcap_valid(seq) && seq[0] != '\0')
549549 t = trie_set(t, seq, (trievalue_T) { .keyseq = keymap[i].keyseq });
550550 }
551551
Show on old repository browser