summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-08-06 19:37:35 +0200
committerAlfred E. Heggestad <aeh@db.org>2016-08-06 19:37:35 +0200
commit7f35380ee3a39faad1f10fcbb6b115b8ddc5f2a7 (patch)
tree32ba72b0a01a0f5a2f2400c991af843175e2396d /src
parent400c9533b4f6e072b560345f7e4348d6a51106a9 (diff)
define KEYCODE_NONE and change value of KEYCODE_REL to -1
Diffstat (limited to 'src')
-rw-r--r--src/cmd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cmd.c b/src/cmd.c
index 9143a3e..cd70f5b 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -286,15 +286,17 @@ int cmd_process(struct cmd_ctx **ctxp, char key, struct re_printf *pf,
/* check for parameters */
if (cmd->flags & CMD_PRM) {
+ int err = 0;
+
if (ctxp) {
- int err = ctx_alloc(ctxp, cmd);
+ err = ctx_alloc(ctxp, cmd);
if (err)
return err;
}
- return cmd_process_edit(ctxp,
- isdigit(key) ? key : 0,
- pf, data);
+ key = isdigit(key) ? key : KEYCODE_REL;
+
+ return cmd_process_edit(ctxp, key, pf, data);
}
arg.key = key;