summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/options.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-01-30 21:41:18 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-01-30 21:41:18 +0000
commit6127ed20408f93f972c67ecf5f5150dd01b6d1eb (patch)
treeb415b09ad72d3be91a1be7b1bbfb948bc09ca7ce /usr.bin/tmux/options.c
parentb58e4d89c8d149b25a11c7a80c7f5c2feed20148 (diff)
When a flag option is used in a format, it should use the number form
not string.
Diffstat (limited to 'usr.bin/tmux/options.c')
-rw-r--r--usr.bin/tmux/options.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/tmux/options.c b/usr.bin/tmux/options.c
index c6f0f2c4eb2..992b8f1e98b 100644
--- a/usr.bin/tmux/options.c
+++ b/usr.bin/tmux/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.31 2017/01/24 19:11:46 nicm Exp $ */
+/* $OpenBSD: options.c,v 1.32 2017/01/30 21:41:17 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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];