From f7860aec7610be897155046bd730ad0b406bd56c Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 18 Jun 2021 16:18:41 +0200 Subject: config: add new function config_clone() --- spawn.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'spawn.c') diff --git a/spawn.c b/spawn.c index 22f0d1ed..8adef19d 100644 --- a/spawn.c +++ b/spawn.c @@ -114,7 +114,7 @@ spawn_expand_template(const struct config_spawn_template *template, *argc = 0; *argv = NULL; - for (; template->argv[*argc] != NULL; (*argc)++) + for (; template->argv.args[*argc] != NULL; (*argc)++) ; #define append(s, n) \ @@ -133,7 +133,7 @@ spawn_expand_template(const struct config_spawn_template *template, char *expanded = NULL; char *start = NULL; - char *last_end = template->argv[i]; + char *last_end = template->argv.args[i]; while ((start = strstr(last_end, "${")) != NULL) { /* Append everything from the last template's end to this @@ -173,7 +173,9 @@ spawn_expand_template(const struct config_spawn_template *template, last_end = end + 1; } - append(last_end, template->argv[i] + strlen(template->argv[i]) - last_end); + append( + last_end, + template->argv.args[i] + strlen(template->argv.args[i]) - last_end); (*argv)[i] = expanded; } (*argv)[*argc] = NULL; -- cgit v1.3