version 1.71, 2020/04/13 14:46:04 |
version 1.72, 2020/04/13 15:55:51 |
|
|
|
|
struct client *client; |
struct client *client; |
struct cmdq_item *item; |
struct cmdq_item *item; |
struct key_event event; |
|
}; |
}; |
|
|
static enum cmd_retval |
static enum cmd_retval |
|
|
{ |
{ |
struct args *args = cmd_get_args(self); |
struct args *args = cmd_get_args(self); |
struct cmd_find_state *target = cmdq_get_target(item); |
struct cmd_find_state *target = cmdq_get_target(item); |
struct key_event *event = cmdq_get_event(item); |
struct cmdq_state *state = cmdq_get_state(item); |
struct cmd_if_shell_data *cdata; |
struct cmd_if_shell_data *cdata; |
char *shellcmd, *cmd; |
char *shellcmd, *cmd; |
const char *file; |
const char *file; |
|
|
free(pr->error); |
free(pr->error); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
case CMD_PARSE_SUCCESS: |
case CMD_PARSE_SUCCESS: |
new_item = cmdq_get_command(pr->cmdlist, target, event, |
new_item = cmdq_get_command(pr->cmdlist, state); |
0); |
|
cmdq_insert_after(item, new_item); |
cmdq_insert_after(item, new_item); |
cmd_list_free(pr->cmdlist); |
cmd_list_free(pr->cmdlist); |
break; |
break; |
|
|
cdata->cmd_else = xstrdup(args->argv[2]); |
cdata->cmd_else = xstrdup(args->argv[2]); |
else |
else |
cdata->cmd_else = NULL; |
cdata->cmd_else = NULL; |
memcpy(&cdata->event, event, sizeof cdata->event); |
|
|
|
if (!args_has(args, 'b')) |
if (!args_has(args, 'b')) |
cdata->client = cmdq_get_client(item); |
cdata->client = cmdq_get_client(item); |
|
|
{ |
{ |
struct cmd_if_shell_data *cdata = job_get_data(job); |
struct cmd_if_shell_data *cdata = job_get_data(job); |
struct client *c = cdata->client; |
struct client *c = cdata->client; |
struct key_event *event = &cdata->event; |
|
struct cmdq_item *new_item = NULL; |
struct cmdq_item *new_item = NULL; |
|
struct cmdq_state *new_state = NULL; |
char *cmd; |
char *cmd; |
int status; |
int status; |
struct cmd_parse_result *pr; |
struct cmd_parse_result *pr; |
|
|
free(pr->error); |
free(pr->error); |
break; |
break; |
case CMD_PARSE_SUCCESS: |
case CMD_PARSE_SUCCESS: |
new_item = cmdq_get_command(pr->cmdlist, NULL, event, 0); |
if (cdata->item == NULL) |
|
new_state = cmdq_new_state(NULL, NULL, 0); |
|
else |
|
new_state = cmdq_get_state(cdata->item); |
|
new_item = cmdq_get_command(pr->cmdlist, new_state); |
|
if (cdata->item == NULL) |
|
cmdq_free_state(new_state); |
cmd_list_free(pr->cmdlist); |
cmd_list_free(pr->cmdlist); |
break; |
break; |
} |
} |