[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [PATCH v3] src/host.c (sufmatch): Fix dot-prefixed domain
From: |
Tim Rühsen |
Subject: |
Re: [Bug-wget] [PATCH v3] src/host.c (sufmatch): Fix dot-prefixed domain matching |
Date: |
Fri, 26 Oct 2018 22:58:04 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
Applied. Thanks for your contribution !
Regards, Tim
On 25.10.18 22:39, address@hidden wrote:
> From: Luiz Angelo Daros de Luca <address@hidden>
>
> Current sufmatch does not match when domain is dot-prefixed.
> The example of no_proxy in man (.mit.edu) does use a dot-prefixed
> domain.
>
> Signed-off-by: Luiz Angelo Daros de Luca <address@hidden>
> ---
> src/host.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/host.c b/src/host.c
> index b42cd6e8..2bf848f3 100644
> --- a/src/host.c
> +++ b/src/host.c
> @@ -1033,8 +1033,9 @@ sufmatch (const char **list, const char *what)
> /* Domain or subdomain match
> * k == -1: exact match
> * k >= 0 && what[k] == '.': subdomain match
> + * k >= 0 && list[i][0] == '.': dot-prefixed subdomain match
> */
> - if (j == -1 && (k == -1 || what[k] == '.'))
> + if (j == -1 && (k == -1 || what[k] == '.' || list[i][0] == '.'))
> return true;
> }
>
>
signature.asc
Description: OpenPGP digital signature