diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2013-03-22 15:50:42 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2013-03-22 15:50:42 +0000 |
commit | a1722d5c2e545e4cce376848aab8a39465d3a036 (patch) | |
tree | 6f2614e239f60bf789d1cda858cf5d4e12e8a081 /cmd-command-prompt.c | |
parent | 0ff9275ad75e7ef8933d290bb274d5420a625b4f (diff) |
Remove unnecessary initializers of cmd_ctx.
Diffstat (limited to 'cmd-command-prompt.c')
-rw-r--r-- | cmd-command-prompt.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c index 6c3df4ef..68573195 100644 --- a/cmd-command-prompt.c +++ b/cmd-command-prompt.c @@ -150,7 +150,7 @@ cmd_command_prompt_callback(void *data, const char *s) struct cmd_command_prompt_cdata *cdata = data; struct client *c = cdata->c; struct cmd_list *cmdlist; - struct cmd_ctx ctx; + struct cmd_ctx *ctx; char *cause, *new_template, *prompt, *ptr; char *input = NULL; @@ -184,17 +184,15 @@ cmd_command_prompt_callback(void *data, const char *s) return (0); } - ctx.msgdata = NULL; - ctx.curclient = c; + ctx = cmd_get_ctx(); + ctx->curclient = c; + ctx->error = key_bindings_error; + ctx->print = key_bindings_print; + ctx->info = key_bindings_info; - ctx.error = key_bindings_error; - ctx.print = key_bindings_print; - ctx.info = key_bindings_info; - - ctx.cmdclient = NULL; - - cmd_list_exec(cmdlist, &ctx); + cmd_list_exec(cmdlist, ctx); cmd_list_free(cmdlist); + cmd_free_ctx(ctx); if (c->prompt_callbackfn != (void *) &cmd_command_prompt_callback) return (1); |