summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/config.c2
-rw-r--r--credential.c2
-rw-r--r--http.c2
-rw-r--r--urlmatch.h4
4 files changed, 7 insertions, 3 deletions
diff --git a/builtin/config.c b/builtin/config.c
index 865fddd..542d8d0 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -575,7 +575,7 @@ static int get_urlmatch(const char *var, const char *url)
int ret;
char *section_tail;
struct string_list_item *item;
- struct urlmatch_config config = { STRING_LIST_INIT_DUP };
+ struct urlmatch_config config = URLMATCH_CONFIG_INIT;
struct string_list values = STRING_LIST_INIT_DUP;
config.collect_fn = urlmatch_collect_fn;
diff --git a/credential.c b/credential.c
index 000ac7a..e7240f3 100644
--- a/credential.c
+++ b/credential.c
@@ -105,7 +105,7 @@ static int match_partial_url(const char *url, void *cb)
static void credential_apply_config(struct credential *c)
{
char *normalized_url;
- struct urlmatch_config config = { STRING_LIST_INIT_DUP };
+ struct urlmatch_config config = URLMATCH_CONFIG_INIT;
struct strbuf url = STRBUF_INIT;
if (!c->host)
diff --git a/http.c b/http.c
index d7c2049..da12471 100644
--- a/http.c
+++ b/http.c
@@ -990,7 +990,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
char *low_speed_limit;
char *low_speed_time;
char *normalized_url;
- struct urlmatch_config config = { STRING_LIST_INIT_DUP };
+ struct urlmatch_config config = URLMATCH_CONFIG_INIT;
config.section = "http";
config.key = NULL;
diff --git a/urlmatch.h b/urlmatch.h
index 6ff42f8..34a3ba6 100644
--- a/urlmatch.h
+++ b/urlmatch.h
@@ -66,6 +66,10 @@ struct urlmatch_config {
int (*fallback_match_fn)(const char *url, void *cb);
};
+#define URLMATCH_CONFIG_INIT { \
+ .vars = STRING_LIST_INIT_DUP, \
+}
+
int urlmatch_config_entry(const char *var, const char *value, void *cb);
#endif /* URL_MATCH_H */