Sync OpenBSD patchset 545:

Mark -n keys with (no prefix) rather than [].
This commit is contained in:
Tiago Cunha
2009-11-19 22:15:58 +00:00
parent ec48709dc2
commit 8777a809dc
2 changed files with 11 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-list-keys.c,v 1.22 2009-11-14 17:56:39 tcunha Exp $ */
/* $Id: cmd-list-keys.c,v 1.23 2009-11-19 22:15:58 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -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);
}