=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-command-prompt.c,v retrieving revision 1.37 retrieving revision 1.38 diff -c -r1.37 -r1.38 *** src/usr.bin/tmux/cmd-command-prompt.c 2016/10/16 17:55:14 1.37 --- src/usr.bin/tmux/cmd-command-prompt.c 2016/10/16 19:04:05 1.38 *************** *** 1,4 **** ! /* $OpenBSD: cmd-command-prompt.c,v 1.37 2016/10/16 17:55:14 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-command-prompt.c,v 1.38 2016/10/16 19:04:05 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 29,35 **** * Prompt for command in client. */ ! static enum cmd_retval cmd_command_prompt_exec(struct cmd *, struct cmd_q *); static int cmd_command_prompt_callback(void *, const char *); static void cmd_command_prompt_free(void *); --- 29,36 ---- * Prompt for command in client. */ ! static enum cmd_retval cmd_command_prompt_exec(struct cmd *, ! struct cmdq_item *); static int cmd_command_prompt_callback(void *, const char *); static void cmd_command_prompt_free(void *); *************** *** 59,70 **** }; static enum cmd_retval ! cmd_command_prompt_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; const char *inputs, *prompts; struct cmd_command_prompt_cdata *cdata; ! struct client *c = cmdq->state.c; char *prompt, *ptr, *input = NULL; size_t n; int flags; --- 60,71 ---- }; static enum cmd_retval ! cmd_command_prompt_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; const char *inputs, *prompts; struct cmd_command_prompt_cdata *cdata; ! struct client *c = item->state.c; char *prompt, *ptr, *input = NULL; size_t n; int flags; *************** *** 122,132 **** } static enum cmd_retval ! cmd_command_prompt_error(struct cmd_q *cmdq, void *data) { char *error = data; ! cmdq_error(cmdq, "%s", error); free(error); return (CMD_RETURN_NORMAL); --- 123,133 ---- } static enum cmd_retval ! cmd_command_prompt_error(struct cmdq_item *item, void *data) { char *error = data; ! cmdq_error(item, "%s", error); free(error); return (CMD_RETURN_NORMAL); *************** *** 138,144 **** struct cmd_command_prompt_cdata *cdata = data; struct client *c = cdata->c; struct cmd_list *cmdlist; ! struct cmd_q *new_cmdq; char *cause, *new_template, *prompt, *ptr; char *input = NULL; --- 139,145 ---- struct cmd_command_prompt_cdata *cdata = data; struct client *c = cdata->c; struct cmd_list *cmdlist; ! struct cmdq_item *new_item; char *cause, *new_template, *prompt, *ptr; char *input = NULL; *************** *** 165,181 **** if (cmd_string_parse(new_template, &cmdlist, NULL, 0, &cause) != 0) { if (cause != NULL) { ! new_cmdq = cmdq_get_callback(cmd_command_prompt_error, cause); } else ! new_cmdq = NULL; } else { ! new_cmdq = cmdq_get_command(cmdlist, NULL, NULL, 0); cmd_list_free(cmdlist); } ! if (new_cmdq != NULL) ! cmdq_append(c, new_cmdq); if (c->prompt_callbackfn != (void *)&cmd_command_prompt_callback) return (1); --- 166,182 ---- if (cmd_string_parse(new_template, &cmdlist, NULL, 0, &cause) != 0) { if (cause != NULL) { ! new_item = cmdq_get_callback(cmd_command_prompt_error, cause); } else ! new_item = NULL; } else { ! new_item = cmdq_get_command(cmdlist, NULL, NULL, 0); cmd_list_free(cmdlist); } ! if (new_item != NULL) ! cmdq_append(c, new_item); if (c->prompt_callbackfn != (void *)&cmd_command_prompt_callback) return (1);