Show 31 quoted lines
> diff --git a/urlmatch.c b/urlmatch.c
> index 20bc2d009c..0c2ddf2e40 100644
> --- a/urlmatch.c
> +++ b/urlmatch.c
> @@ -274,12 +274,20 @@ static char *url_normalize_1(const char *url, struct url_info *out_info, bool al
> if (url == slash_ptr) {
> /* Skip ":" port with no number, it's same as default */
> } else if (slash_ptr - url == 2 &&
> - starts_with(norm.buf, "http:") &&
> - !strncmp(url, "80", 2)) {
> + starts_with(norm.buf, "ftp:") &&
> + !strncmp(url, "21", 2)) {
> + /* Skip http :21 as it's the default */
> + } else if (slash_ptr - url == 2 &&
> + starts_with(norm.buf, "ssh:") &&
> + !strncmp(url, "22", 2)) {
> + /* Skip http :22 as it's the default */
> + } else if (slash_ptr - url == 2 &&
> + starts_with(norm.buf, "http:") &&
> + !strncmp(url, "80", 2)) {
> /* Skip http :80 as it's the default */
> } else if (slash_ptr - url == 3 &&
> - starts_with(norm.buf, "https:") &&
> - !strncmp(url, "443", 3)) {
> + starts_with(norm.buf, "https:") &&
> + !strncmp(url, "443", 3)) {
> /* Skip https :443 as it's the default */
> } else {
> /*
> --
> 2.50.1 (Apple Git-155)Just offhand, not commenting on the rest of the series : the comments look wrong for ftp, ssh to me.