aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-01-31 00:01:12 +0000
committerThomas Adam <thomas@xteddy.org>2017-01-31 00:01:12 +0000
commitd8da761d54ed0d2b449e412511496e67ce8d33ac (patch)
tree56606ce4edbee5b9c57aaf7f6691e1dd9e077ce5
parent9094f01c6bf3de3cca17a3303a46adce268d9107 (diff)
parent3408595f77920764bf6c4c313a0abc6a1cfb8048 (diff)
downloadrtmux-d8da761d54ed0d2b449e412511496e67ce8d33ac.tar.gz
rtmux-d8da761d54ed0d2b449e412511496e67ce8d33ac.tar.bz2
rtmux-d8da761d54ed0d2b449e412511496e67ce8d33ac.zip
Merge branch 'obsd-master'
-rw-r--r--cmd-show-options.c2
-rw-r--r--format.c2
-rw-r--r--options.c7
-rw-r--r--tmux.h2
4 files changed, 8 insertions, 5 deletions
diff --git a/cmd-show-options.c b/cmd-show-options.c
index e6347d68..f1adcc93 100644
--- a/cmd-show-options.c
+++ b/cmd-show-options.c
@@ -109,7 +109,7 @@ cmd_show_options_print(struct cmd *self, struct cmdq_item *item,
name = options_name(o);
}
- value = options_tostring(o, idx);
+ value = options_tostring(o, idx, 0);
if (args_has(self->args, 'v'))
cmdq_print(item, "%s", value);
else if (options_isstring(o)) {
diff --git a/format.c b/format.c
index 6fee3c6e..d1658b77 100644
--- a/format.c
+++ b/format.c
@@ -658,7 +658,7 @@ format_find(struct format_tree *ft, const char *key, int modifiers)
if (o == NULL)
o = options_parse_get(global_s_options, key, &idx, 0);
if (o != NULL) {
- found = options_tostring(o, idx);
+ found = options_tostring(o, idx, 1);
goto found;
}
}
diff --git a/options.c b/options.c
index 37263b53..4de25937 100644
--- a/options.c
+++ b/options.c
@@ -325,7 +325,7 @@ options_isstring(struct options_entry *o)
}
const char *
-options_tostring(struct options_entry *o, int idx)
+options_tostring(struct options_entry *o, int idx, int numeric)
{
static char s[1024];
const char *tmp;
@@ -355,7 +355,10 @@ options_tostring(struct options_entry *o, int idx)
tmp = attributes_tostring(o->number);
break;
case OPTIONS_TABLE_FLAG:
- tmp = (o->number ? "on" : "off");
+ if (numeric)
+ xsnprintf(s, sizeof s, "%lld", o->number);
+ else
+ tmp = (o->number ? "on" : "off");
break;
case OPTIONS_TABLE_CHOICE:
tmp = o->tableentry->choices[o->number];
diff --git a/tmux.h b/tmux.h
index cb74add9..de1b823a 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1564,7 +1564,7 @@ int options_array_set(struct options_entry *, u_int, const char *,
int options_array_size(struct options_entry *, u_int *);
void options_array_assign(struct options_entry *, const char *);
int options_isstring(struct options_entry *);
-const char *options_tostring(struct options_entry *, int);
+const char *options_tostring(struct options_entry *, int, int);
char *options_parse(const char *, int *);
struct options_entry *options_parse_get(struct options *, const char *, int *,
int);