aboutsummaryrefslogtreecommitdiffstats
path: root/run-command.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-07-16 17:42:52 -0700
committerJunio C Hamano <gitster@pobox.com>2021-07-16 17:42:53 -0700
commitbd4232fac3319890429ec303e2f7c3d287c8eaa3 (patch)
treeb5032aca9cdafb5812801f2868cabddc23e2052a /run-command.c
parentMerge branch 'dd/test-stdout-count-lines' (diff)
parentstring-list.h users: change to use *_{nodup,dup}() (diff)
downloadgit-bd4232fac3319890429ec303e2f7c3d287c8eaa3.tar.gz
git-bd4232fac3319890429ec303e2f7c3d287c8eaa3.zip
Merge branch 'ab/struct-init'
Code cleanup around struct_type_init() functions. * ab/struct-init: string-list.h users: change to use *_{nodup,dup}() string-list.[ch]: add a string_list_init_{nodup,dup}() dir.[ch]: replace dir_init() with DIR_INIT *.c *_init(): define in terms of corresponding *_INIT macro *.h: move some *_INIT to designated initializers
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/run-command.c b/run-command.c
index be6bc128cd..8750df16d8 100644
--- a/run-command.c
+++ b/run-command.c
@@ -11,9 +11,8 @@
void child_process_init(struct child_process *child)
{
- memset(child, 0, sizeof(*child));
- strvec_init(&child->args);
- strvec_init(&child->env_array);
+ struct child_process blank = CHILD_PROCESS_INIT;
+ memcpy(child, &blank, sizeof(*child));
}
void child_process_clear(struct child_process *child)