summaryrefslogtreecommitdiffstats
path: root/cmd-unbind-key.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2011-01-21 23:46:09 +0000
committerTiago Cunha <tcunha@gmx.com>2011-01-21 23:46:09 +0000
commit6c3186a19aff18c715a9491e487dec5dc71d50b8 (patch)
tree007c31b40c1b8d0bb74c115292fa291a20779922 /cmd-unbind-key.c
parent10a5a2175e5880905374bac61de4197941e059c6 (diff)
Sync OpenBSD patchset 837:
unbind-key -a is allowed no arguments.
Diffstat (limited to 'cmd-unbind-key.c')
-rw-r--r--cmd-unbind-key.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd-unbind-key.c b/cmd-unbind-key.c
index 0e9b5fa9..8e4c8e50 100644
--- a/cmd-unbind-key.c
+++ b/cmd-unbind-key.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-unbind-key.c,v 1.24 2011-01-07 14:45:34 tcunha Exp $ */
+/* $Id: cmd-unbind-key.c,v 1.25 2011-01-21 23:46:09 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -31,7 +31,7 @@ int cmd_unbind_key_table(struct cmd *, struct cmd_ctx *, int);
const struct cmd_entry cmd_unbind_key_entry = {
"unbind-key", "unbind",
- "acnt:", 1, 1,
+ "acnt:", 0, 1,
"[-acn] [-t key-table] key",
0,
NULL,
@@ -43,6 +43,8 @@ int
cmd_unbind_key_check(struct args *args)
{
if (args_has(args, 'a') && (args->argc != 0 || args_has(args, 't')))
+ return (-1);
+ if (!args_has(args, 'a') && args->argc != 1)
return (-1);
return (0);
}