summaryrefslogtreecommitdiffstats
path: root/tty-term.c
diff options
context:
space:
mode:
authornicm <nicm>2019-03-18 11:58:40 +0000
committernicm <nicm>2019-03-18 11:58:40 +0000
commitce6be7afd4d10b542f9cce8634d6bdd81754f775 (patch)
tree01a13843f212816c057069a13d02b46743ed8fd0 /tty-term.c
parentd2d43987d0f35af2bc012f1260fdb81c851fe390 (diff)
Make array options a sparse tree instead of an array of char * and
remove the size limit.
Diffstat (limited to 'tty-term.c')
-rw-r--r--tty-term.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tty-term.c b/tty-term.c
index 7df9a7d1..9e0bb63d 100644
--- a/tty-term.c
+++ b/tty-term.c
@@ -416,7 +416,8 @@ tty_term_find(char *name, int fd, char **cause)
const struct tty_term_code_entry *ent;
struct tty_code *code;
struct options_entry *o;
- u_int size, i;
+ struct options_array_item *a;
+ u_int i;
int n, error;
const char *s, *acs;
@@ -491,12 +492,12 @@ tty_term_find(char *name, int fd, char **cause)
/* Apply terminal overrides. */
o = options_get_only(global_options, "terminal-overrides");
- if (options_array_size(o, &size) != -1) {
- for (i = 0; i < size; i++) {
- s = options_array_get(o, i);
- if (s != NULL)
- tty_term_override(term, s);
- }
+ a = options_array_first(o);
+ while (a != NULL) {
+ s = options_array_item_value(a);
+ if (s != NULL)
+ tty_term_override(term, s);
+ a = options_array_next(a);
}
/* Delete curses data. */