version 1.4, 2019/05/20 11:46:06 |
version 1.5, 2019/05/23 11:13:30 |
|
|
u_int i; |
u_int i; |
int count = menu->count, old = md->choice; |
int count = menu->count, old = md->choice; |
const struct menu_item *item; |
const struct menu_item *item; |
struct cmd_list *cmdlist; |
|
struct cmdq_item *new_item; |
struct cmdq_item *new_item; |
char *cause; |
struct cmd_parse_result *pr; |
|
|
if (KEYC_IS_MOUSE(event->key)) { |
if (KEYC_IS_MOUSE(event->key)) { |
if (md->flags & MENU_NOMOUSE) |
if (md->flags & MENU_NOMOUSE) |
|
|
md->cb = NULL; |
md->cb = NULL; |
return (1); |
return (1); |
} |
} |
cmdlist = cmd_string_parse(item->command, NULL, 0, &cause); |
|
if (cmdlist == NULL) { |
pr = cmd_parse_from_string(item->command, NULL); |
if (cause != NULL) |
switch (pr->status) { |
new_item = cmdq_get_error(cause); |
case CMD_PARSE_EMPTY: |
else |
new_item = NULL; |
new_item = NULL; |
break; |
free(cause); |
case CMD_PARSE_ERROR: |
} else { |
new_item = cmdq_get_error(pr->error); |
new_item = cmdq_get_command(cmdlist, NULL, NULL, 0); |
free(pr->error); |
cmd_list_free(cmdlist); |
cmdq_append(c, new_item); |
} |
break; |
if (new_item != NULL) { |
case CMD_PARSE_SUCCESS: |
if (md->item != NULL) |
new_item = cmdq_get_command(pr->cmdlist, NULL, NULL, 0); |
cmdq_insert_after(md->item, new_item); |
cmd_list_free(pr->cmdlist); |
else |
cmdq_append(c, new_item); |
cmdq_append(c, new_item); |
break; |
} |
} |
return (1); |
return (1); |
} |
} |