diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-11-18 10:18:25 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-11-18 10:18:25 +0000 |
commit | 68f5c9c72da0c4430733de2094fbb8bc4d1e0474 (patch) | |
tree | ffd1dfd0e4f8a4ea3e8bd5a72520c126f5e5b6df /cmd-list-keys.c | |
parent | a9ca8df8e3c477560dc6455cd4c73e582b89aef5 (diff) | |
download | rtmux-68f5c9c72da0c4430733de2094fbb8bc4d1e0474.tar.gz rtmux-68f5c9c72da0c4430733de2094fbb8bc4d1e0474.tar.bz2 rtmux-68f5c9c72da0c4430733de2094fbb8bc4d1e0474.zip |
Mark -n keys with (no prefix) rather than [].
Diffstat (limited to 'cmd-list-keys.c')
-rw-r--r-- | cmd-list-keys.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd-list-keys.c b/cmd-list-keys.c index b61951f9..13785fac 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -71,13 +71,15 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_ctx *ctx) key = key_string_lookup_key(bd->key & ~KEYC_PREFIX); if (key == NULL) continue; - if (!(bd->key & KEYC_PREFIX)) - used = xsnprintf(tmp, sizeof tmp, "[%s]: ", key); - else - used = xsnprintf(tmp, sizeof tmp, "%*s: ", width, key); + used = xsnprintf(tmp, sizeof tmp, "%*s: ", width, key); if (used >= sizeof tmp) continue; + if (!(bd->key & KEYC_PREFIX)) { + used = strlcat(tmp, "(no prefix) ", sizeof tmp); + if (used >= sizeof tmp) + continue; + } cmd_list_print(bd->cmdlist, tmp + used, (sizeof tmp) - used); ctx->print(ctx, "%s", tmp); } |