From ee7ea4907ccef604f764df5e223640ad04192f6d Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Wed, 27 May 2026 16:08:14 +0200 Subject: [PATCH] urlmatch: change 'allow_globs' arg to bool The last argument of url_normalize_1() is `char allow_globs` but it is used as a boolean, not as a char. Let's convert it to a `bool`, and while at it convert the two calls to url_normalize_1() so they pass 'true' or 'false' instead of '1' or '0'. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- urlmatch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/urlmatch.c b/urlmatch.c index bf8cce6de9..b2d88a5289 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -112,7 +112,7 @@ static int match_host(const struct url_info *url_info, return (!url_len && !pat_len); } -static char *url_normalize_1(const char *url, struct url_info *out_info, char allow_globs) +static char *url_normalize_1(const char *url, struct url_info *out_info, bool allow_globs) { /* * Normalize NUL-terminated url using the following rules: @@ -438,7 +438,7 @@ static char *url_normalize_1(const char *url, struct url_info *out_info, char al char *url_normalize(const char *url, struct url_info *out_info) { - return url_normalize_1(url, out_info, 0); + return url_normalize_1(url, out_info, false); } char *url_parse(const char *url_orig, struct url_info *out_info) @@ -704,7 +704,7 @@ int urlmatch_config_entry(const char *var, const char *value, struct url_info norm_info; config_url = xmemdupz(key, dot - key); - norm_url = url_normalize_1(config_url, &norm_info, 1); + norm_url = url_normalize_1(config_url, &norm_info, true); if (norm_url) retval = match_urls(url, &norm_info, &matched); else if (collect->fallback_match_fn)