diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-23 18:35:54 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-23 18:35:54 (GMT) |
commit | 955d7be808b455cdf2eb60306a690958c3bb49ca (patch) | |
tree | 5dd47421f110812148213e64446361ac0656240a /string-list.c | |
parent | bc88defa2f9f92324106dca48126039246ab00e1 (diff) | |
parent | f93d7c6fa0548e95ca2795d900671a87c1a88ea3 (diff) | |
download | git-955d7be808b455cdf2eb60306a690958c3bb49ca.zip git-955d7be808b455cdf2eb60306a690958c3bb49ca.tar.gz git-955d7be808b455cdf2eb60306a690958c3bb49ca.tar.bz2 |
Merge branch 'ta/string-list-init'
* ta/string-list-init:
replace memset with string-list initializers
string-list: add string_list initializer helper function
Diffstat (limited to 'string-list.c')
-rw-r--r-- | string-list.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/string-list.c b/string-list.c index aabb25e..db38b62 100644 --- a/string-list.c +++ b/string-list.c @@ -1,6 +1,12 @@ #include "cache.h" #include "string-list.h" +void string_list_init(struct string_list *list, int strdup_strings) +{ + memset(list, 0, sizeof(*list)); + list->strdup_strings = strdup_strings; +} + /* if there is no exact match, point to the index where the entry could be * inserted */ static int get_entry_index(const struct string_list *list, const char *string, |