=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/mode-tree.c,v retrieving revision 1.29 retrieving revision 1.30 diff -c -r1.29 -r1.30 *** src/usr.bin/tmux/mode-tree.c 2019/05/12 18:16:33 1.29 --- src/usr.bin/tmux/mode-tree.c 2019/05/23 11:13:30 1.30 *************** *** 1,4 **** ! /* $OpenBSD: mode-tree.c,v 1.29 2019/05/12 18:16:33 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: mode-tree.c,v 1.30 2019/05/23 11:13:30 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott *************** *** 1045,1052 **** const char *template, const char *name) { struct cmdq_item *new_item; ! struct cmd_list *cmdlist; ! char *command, *cause; command = cmd_template_replace(template, name, 1); if (command == NULL || *command == '\0') { --- 1045,1052 ---- const char *template, const char *name) { struct cmdq_item *new_item; ! char *command; ! struct cmd_parse_result *pr; command = cmd_template_replace(template, name, 1); if (command == NULL || *command == '\0') { *************** *** 1054,1070 **** return; } ! cmdlist = cmd_string_parse(command, NULL, 0, &cause); ! if (cmdlist == NULL) { ! if (cause != NULL && c != NULL) { ! *cause = toupper((u_char)*cause); ! status_message_set(c, "%s", cause); } ! free(cause); ! } else { ! new_item = cmdq_get_command(cmdlist, fs, NULL, 0); cmdq_append(c, new_item); ! cmd_list_free(cmdlist); } free(command); --- 1054,1075 ---- return; } ! pr = cmd_parse_from_string(command, NULL); ! switch (pr->status) { ! case CMD_PARSE_EMPTY: ! break; ! case CMD_PARSE_ERROR: ! if (c != NULL) { ! *pr->error = toupper((u_char)*pr->error); ! status_message_set(c, "%s", pr->error); } ! free(pr->error); ! break; ! case CMD_PARSE_SUCCESS: ! new_item = cmdq_get_command(pr->cmdlist, fs, NULL, 0); cmdq_append(c, new_item); ! cmd_list_free(pr->cmdlist); ! break; } free(command);