summaryrefslogtreecommitdiffstats
path: root/cmd-parse.y
diff options
context:
space:
mode:
authornicm <nicm>2021-08-21 20:46:43 +0000
committernicm <nicm>2021-08-21 20:46:43 +0000
commit069f5925af8bf70a99eec7f4baf5772707e62def (patch)
tree8898596f1984869585d0bf546d4efa5c9d313dde /cmd-parse.y
parent326d2ef234cd8838700e914a0d780f46be50904c (diff)
Preserve argument type in command and convert to string on demand.
Diffstat (limited to 'cmd-parse.y')
-rw-r--r--cmd-parse.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd-parse.y b/cmd-parse.y
index 57d0e84e..86917941 100644
--- a/cmd-parse.y
+++ b/cmd-parse.y
@@ -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;