mirror of
https://github.com/tmux/tmux.git
synced 2026-10-07 02:04:22 +00:00
Change array item keys to be strings instead of numbers which are
painful to work with.
This commit is contained in:
14
colour.c
14
colour.c
@@ -1294,7 +1294,8 @@ colour_palette_from_option(struct colour_palette *p, struct options *oo)
|
||||
{
|
||||
struct options_entry *o;
|
||||
struct options_array_item *a;
|
||||
u_int i, n;
|
||||
union options_value *ov;
|
||||
u_int i;
|
||||
int c;
|
||||
|
||||
if (p == NULL)
|
||||
@@ -1312,12 +1313,11 @@ colour_palette_from_option(struct colour_palette *p, struct options *oo)
|
||||
p->default_palette = xcalloc(256, sizeof *p->default_palette);
|
||||
for (i = 0; i < 256; i++)
|
||||
p->default_palette[i] = -1;
|
||||
while (a != NULL) {
|
||||
n = options_array_item_index(a);
|
||||
if (n < 256) {
|
||||
c = options_array_item_value(a)->number;
|
||||
p->default_palette[n] = c;
|
||||
for (i = 0; i < 256; i++) {
|
||||
ov = options_array_getv(o, "%u", i);
|
||||
if (ov != NULL) {
|
||||
c = ov->number;
|
||||
p->default_palette[i] = c;
|
||||
}
|
||||
a = options_array_next(a);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user