=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/status.c,v retrieving revision 1.190 retrieving revision 1.191 diff -c -r1.190 -r1.191 *** src/usr.bin/tmux/status.c 2019/03/18 09:46:42 1.190 --- src/usr.bin/tmux/status.c 2019/03/18 11:58:40 1.191 *************** *** 1,4 **** ! /* $OpenBSD: status.c,v 1.190 2019/03/18 09:46:42 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: status.c,v 1.191 2019/03/18 11:58:40 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1510,1518 **** const char **layout, *value, *cp; const struct cmd_entry **cmdent; const struct options_table_entry *oe; ! u_int items, idx; size_t slen = strlen(s), valuelen; struct options_entry *o; const char *layouts[] = { "even-horizontal", "even-vertical", "main-horizontal", "main-vertical", "tiled", NULL --- 1510,1519 ---- const char **layout, *value, *cp; const struct cmd_entry **cmdent; const struct options_table_entry *oe; ! u_int idx; size_t slen = strlen(s), valuelen; struct options_entry *o; + struct options_array_item *a; const char *layouts[] = { "even-horizontal", "even-vertical", "main-horizontal", "main-vertical", "tiled", NULL *************** *** 1538,1553 **** } } o = options_get_only(global_options, "command-alias"); ! if (o != NULL && options_array_size(o, &items) != -1) { ! for (idx = 0; idx < items; idx++) { ! value = options_array_get(o, idx); if (value == NULL || (cp = strchr(value, '=')) == NULL) ! continue; valuelen = cp - value; if (slen > valuelen || strncmp(value, s, slen) != 0) ! continue; list = xreallocarray(list, (*size) + 1, sizeof *list); list[(*size)++] = xstrndup(value, valuelen); } } for (idx = 0; idx < (*size); idx++) --- 1539,1560 ---- } } o = options_get_only(global_options, "command-alias"); ! if (o != NULL) { ! a = options_array_first(o); ! while (a != NULL) { ! value = options_array_item_value(a);; if (value == NULL || (cp = strchr(value, '=')) == NULL) ! goto next; ! valuelen = cp - value; if (slen > valuelen || strncmp(value, s, slen) != 0) ! goto next; ! list = xreallocarray(list, (*size) + 1, sizeof *list); list[(*size)++] = xstrndup(value, valuelen); + + next: + a = options_array_next(a); } } for (idx = 0; idx < (*size); idx++)