summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Angelo Daros de Luca <luizluca@gmail.com>2018-10-25 17:39:52 -0300
committerTim Rühsen <tim.ruehsen@gmx.de>2018-10-26 22:54:26 +0200
commitfd85ac9cc623847e9d94d9f9241ab34e2c146cbf (patch)
treeb92ea7f36dfbde8189b559230bde492e2ad2d3ec
parent21daa24e7214ed4e6505c7068412545b5ac47ff3 (diff)
downloadwget-fd85ac9cc623847e9d94d9f9241ab34e2c146cbf.tar.gz
* src/host.c (sufmatch): Fix dot-prefixed domain matching
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 <luizluca@gmail.com> Copyright-paperwork-exempt: Yes
-rw-r--r--src/host.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/host.c b/src/host.c
index b42cd6e..2bf848f 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;
}