Preserve argument type in command and convert to string on demand.

This commit is contained in:
nicm
2021-08-21 20:46:43 +00:00
parent 326d2ef234
commit 069f5925af
4 changed files with 53 additions and 33 deletions

View File

@ -804,7 +804,8 @@ cmd_parse_build_command(struct cmd_parse_command *cmd,
return (cmdlist);
TAILQ_FOREACH(arg, &cmd->arguments, entry) {
values = xreallocarray(values, count + 1, sizeof *values);
values = xrecallocarray(values, count, count + 1,
sizeof *values);
switch (arg->type) {
case CMD_PARSE_STRING:
values[count].type = ARGS_STRING;