Replace %% in command lists (by copying them) for template arguments ,

this means they can be used with {} as well. Also make argument
processing from an existing vector preserve commands. GitHub issue 2858.
This commit is contained in:
nicm
2021-08-27 17:25:55 +00:00
parent fd756a150b
commit daec63e5e6
16 changed files with 324 additions and 150 deletions

View File

@ -58,8 +58,7 @@ cmd_bind_key_exec(struct cmd *self, struct cmdq_item *item)
key_code key;
const char *tablename, *note = args_get(args, 'N');
struct cmd_parse_result *pr;
char **argv;
int argc, repeat;
int repeat;
struct args_value *value;
u_int count = args_count(args);
@ -92,9 +91,8 @@ cmd_bind_key_exec(struct cmd *self, struct cmdq_item *item)
if (count == 2)
pr = cmd_parse_from_string(args_string(args, 1), NULL);
else {
args_vector(args, &argc, &argv);
pr = cmd_parse_from_arguments(argc - 1, argv + 1, NULL);
cmd_free_argv(argc, argv);
pr = cmd_parse_from_arguments(args_values(args) + 1, count - 1,
NULL);
}
switch (pr->status) {
case CMD_PARSE_ERROR: