summaryrefslogtreecommitdiffstats
path: root/strvec.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 /strvec.c
parent832a239b72779e97b09943d77b9097ed8376e18e (diff)
parentbc40dfb10a06612813a3f9b733d65af0732208b2 (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 'strvec.c')
-rw-r--r--strvec.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/strvec.c b/strvec.c
index 21dce0a7a4..61a76ce6cb 100644
--- a/strvec.c
+++ b/strvec.c
@@ -6,9 +6,8 @@ const char *empty_strvec[] = { NULL };
void strvec_init(struct strvec *array)
{
- array->v = empty_strvec;
- array->nr = 0;
- array->alloc = 0;
+ struct strvec blank = STRVEC_INIT;
+ memcpy(array, &blank, sizeof(*array));
}
static void strvec_push_nodup(struct strvec *array, const char *value)