diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-01-21 19:36:40 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-01-21 19:36:40 +0000 |
commit | a7b0b30bdd73f3a8d513fc69daf593174ee03145 (patch) | |
tree | dc44cb8d870c4786d9349be8ce123098d022d9f2 /options-table.c | |
parent | d4c2a935f2039e00a7a7384fa0427a6126111611 (diff) | |
download | rtmux-a7b0b30bdd73f3a8d513fc69daf593174ee03145.tar.gz rtmux-a7b0b30bdd73f3a8d513fc69daf593174ee03145.tar.bz2 rtmux-a7b0b30bdd73f3a8d513fc69daf593174ee03145.zip |
Sync OpenBSD patchset 1007:
Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.
Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.
People who want three prefix keys are out of luck :-).
Diffstat (limited to 'options-table.c')
-rw-r--r-- | options-table.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/options-table.c b/options-table.c index 778d5ed5..36544707 100644 --- a/options-table.c +++ b/options-table.c @@ -261,8 +261,13 @@ const struct options_table_entry session_options_table[] = { }, { .name = "prefix", - .type = OPTIONS_TABLE_KEYS, - /* set in main() */ + .type = OPTIONS_TABLE_KEY, + .default_num = '\002', + }, + + { .name = "prefix2", + .type = OPTIONS_TABLE_KEY, + .default_num = KEYC_NONE, }, { .name = "repeat-time", @@ -682,10 +687,8 @@ const char * options_table_print_entry( const struct options_table_entry *oe, struct options_entry *o) { - static char out[BUFSIZ]; - const char *s; - struct keylist *keylist; - u_int i; + static char out[BUFSIZ]; + const char *s; *out = '\0'; switch (oe->type) { @@ -695,14 +698,8 @@ options_table_print_entry( case OPTIONS_TABLE_NUMBER: xsnprintf(out, sizeof out, "%lld", o->num); break; - case OPTIONS_TABLE_KEYS: - keylist = o->data; - for (i = 0; i < ARRAY_LENGTH(keylist); i++) { - s = key_string_lookup_key(ARRAY_ITEM(keylist, i)); - strlcat(out, s, sizeof out); - if (i != ARRAY_LENGTH(keylist) - 1) - strlcat(out, ",", sizeof out); - } + case OPTIONS_TABLE_KEY: + xsnprintf(out, sizeof out, "%s", key_string_lookup_key(o->num)); break; case OPTIONS_TABLE_COLOUR: s = colour_tostring(o->num); |