summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-16 19:18:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-16 19:18:55 (GMT)
commitc6d3abbf994aaef6c56512f2afe2236310e08e39 (patch)
tree78caa8a86a2bb1b14c493e3f4b4caf9b483d2012
parentbbfa0cc7f8fdfb323ad108bb1dbb7543558cf864 (diff)
parentacb3d22264fd3736f95f71aa38e1d6fa01f5e9e1 (diff)
downloadgit-c6d3abbf994aaef6c56512f2afe2236310e08e39.zip
git-c6d3abbf994aaef6c56512f2afe2236310e08e39.tar.gz
git-c6d3abbf994aaef6c56512f2afe2236310e08e39.tar.bz2
Merge branch 'ta/string-list-init'
* ta/string-list-init: string-list: spell all values out that are given to a string_list initializer
-rw-r--r--Documentation/technical/api-string-list.txt2
-rw-r--r--string-list.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt
index 20be348..f1add51 100644
--- a/Documentation/technical/api-string-list.txt
+++ b/Documentation/technical/api-string-list.txt
@@ -200,3 +200,5 @@ Represents the list itself.
You should not tamper with it.
. Setting the `strdup_strings` member to 1 will strdup() the strings
before adding them, see above.
+. The `compare_strings_fn` member is used to specify a custom compare
+ function, otherwise `strcmp()` is used as the default function.
diff --git a/string-list.h b/string-list.h
index de6769c..dd5e294 100644
--- a/string-list.h
+++ b/string-list.h
@@ -15,8 +15,8 @@ struct string_list {
compare_strings_fn cmp; /* NULL uses strcmp() */
};
-#define STRING_LIST_INIT_NODUP { NULL, 0, 0, 0 }
-#define STRING_LIST_INIT_DUP { NULL, 0, 0, 1 }
+#define STRING_LIST_INIT_NODUP { NULL, 0, 0, 0, NULL }
+#define STRING_LIST_INIT_DUP { NULL, 0, 0, 1, NULL }
void print_string_list(const struct string_list *p, const char *text);
void string_list_clear(struct string_list *list, int free_util);