Change array item keys to be strings instead of numbers which are

painful to work with.
This commit is contained in:
nicm
2026-07-06 14:29:10 +00:00
parent 79b83600af
commit 1117caaf09
7 changed files with 53 additions and 48 deletions

View File

@@ -495,7 +495,6 @@ tty_keys_build(struct tty *tty)
u_int i, j;
const char *s;
struct options_entry *o;
struct options_array_item *a;
union options_value *ov;
char copy[16];
key_code key;
@@ -532,12 +531,10 @@ tty_keys_build(struct tty *tty)
o = options_get(global_options, "user-keys");
if (o != NULL) {
a = options_array_first(o);
while (a != NULL) {
i = options_array_item_index(a);
ov = options_array_item_value(a);
tty_keys_add(tty, ov->string, KEYC_USER + i);
a = options_array_next(a);
for (i = 0; i <= KEYC_NUSER; i++) {
ov = options_array_getv(o, "%u", i);
if (ov != NULL)
tty_keys_add(tty, ov->string, KEYC_USER + i);
}
}
}