mirror of
https://github.com/tmux/tmux.git
synced 2025-03-31 03:58:48 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
109d2bda1a
22
options.c
22
options.c
@ -578,10 +578,28 @@ char *
|
|||||||
options_to_string(struct options_entry *o, int idx, int numeric)
|
options_to_string(struct options_entry *o, int idx, int numeric)
|
||||||
{
|
{
|
||||||
struct options_array_item *a;
|
struct options_array_item *a;
|
||||||
|
char *result = NULL;
|
||||||
|
char *last = NULL;
|
||||||
|
char *next;
|
||||||
|
|
||||||
if (OPTIONS_IS_ARRAY(o)) {
|
if (OPTIONS_IS_ARRAY(o)) {
|
||||||
if (idx == -1)
|
if (idx == -1) {
|
||||||
return (xstrdup(""));
|
RB_FOREACH(a, options_array, &o->value.array) {
|
||||||
|
next = options_value_to_string(o, &a->value,
|
||||||
|
numeric);
|
||||||
|
if (last == NULL)
|
||||||
|
result = next;
|
||||||
|
else {
|
||||||
|
xasprintf(&result, "%s %s", last, next);
|
||||||
|
free(last);
|
||||||
|
free(next);
|
||||||
|
}
|
||||||
|
last = result;
|
||||||
|
}
|
||||||
|
if (result == NULL)
|
||||||
|
return (xstrdup(""));
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
a = options_array_item(o, idx);
|
a = options_array_item(o, idx);
|
||||||
if (a == NULL)
|
if (a == NULL)
|
||||||
return (xstrdup(""));
|
return (xstrdup(""));
|
||||||
|
Loading…
Reference in New Issue
Block a user