Sync OpenBSD patchset 847:

Fix bind-key -t.
This commit is contained in:
Tiago Cunha 2011-01-22 00:00:23 +00:00
parent 1930181b18
commit e3defd9b25

View File

@ -1,4 +1,4 @@
/* $Id: cmd-bind-key.c,v 1.30 2011-01-07 14:45:33 tcunha Exp $ */ /* $Id: cmd-bind-key.c,v 1.31 2011-01-22 00:00:23 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -45,7 +45,7 @@ int
cmd_bind_key_check(struct args *args) cmd_bind_key_check(struct args *args)
{ {
if (args_has(args, 't')) { if (args_has(args, 't')) {
if (args->argc != 1) if (args->argc != 2)
return (-1); return (-1);
} else { } else {
if (args->argc < 2) if (args->argc < 2)
@ -99,9 +99,9 @@ cmd_bind_key_table(struct cmd *self, struct cmd_ctx *ctx, int key)
return (-1); return (-1);
} }
cmd = mode_key_fromstring(mtab->cmdstr, args->argv[0]); cmd = mode_key_fromstring(mtab->cmdstr, args->argv[1]);
if (cmd == MODEKEY_NONE) { if (cmd == MODEKEY_NONE) {
ctx->error(ctx, "unknown command: %s", args->argv[0]); ctx->error(ctx, "unknown command: %s", args->argv[1]);
return (-1); return (-1);
} }