about summary refs log tree commit diff stats
path: root/whitelist.c
diff options
context:
space:
mode:
authorElias Norberg <xyzzy@kudzu.se>2012-01-12 00:17:33 +0100
committerElias Norberg <xyzzy@kudzu.se>2012-01-16 19:51:27 +0100
commitbc81e88b13c0ddfa385a10cfbe2ea93259c7f8a4 (patch)
tree9ef03ce4c6316b5b15484a6ca08d582c319fad3d /whitelist.c
parenta8a93c2b7cae6c1d217bca596d8b0b631efe97b7 (diff)
downloadxombrero-bc81e88b13c0ddfa385a10cfbe2ea93259c7f8a4.tar.gz
Use a list of TLD's to properly handle multi-part TLD's
The list used is from publicsuffix.org. It gets installed
to the resource-directory as 'tld-rules'
Diffstat (limited to 'whitelist.c')
-rw-r--r--whitelist.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/whitelist.c b/whitelist.c
index 0336261..a7c3d8a 100644
--- a/whitelist.c
+++ b/whitelist.c
@@ -37,11 +37,7 @@ find_domain(const gchar *s, int toplevel)
 	}
 
 	if (toplevel && !isdigit(uri->host[strlen(uri->host) - 1])) {
-		if ((p = strrchr(uri->host, '.')) != NULL) {
-			while(--p >= uri->host && *p != '.');
-			p++;
-		} else
-			p = uri->host;
+		p = tld_get_suffix(uri->host);
 	} else
 		p = uri->host;