From a681f3f2bb769a752093517d920d57f9df8748c7 Mon Sep 17 00:00:00 2001 From: corvid Date: Fri, 16 Sep 2011 02:01:45 +0000 Subject: put public suffix comparison directly in url.c --- src/url.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/url.c') diff --git a/src/url.c b/src/url.c index faee044a..80be1fa6 100644 --- a/src/url.c +++ b/src/url.c @@ -718,7 +718,7 @@ static uint_t Url_host_public_internal_dots(const char *host) * domain that is in a registry outside the organization. * For 'www.dillo.org', that would be 'dillo.org'. */ -const char *a_Url_host_find_public_suffix(const char *host) +const char *Url_host_find_public_suffix(const char *host) { const char *s; uint_t dots; @@ -753,3 +753,12 @@ const char *a_Url_host_find_public_suffix(const char *host) _MSG("public suffix of %s is %s\n", host, s); return s; } + +bool_t a_Url_same_public_suffix(const DilloUrl *u1, const DilloUrl *u2) +{ + if (!u1 || !u2) + return FALSE; + + return dStrcasecmp(Url_host_find_public_suffix(URL_HOST(u1)), + Url_host_find_public_suffix(URL_HOST(u2))) ? FALSE :TRUE; +} -- cgit v1.2.3