summaryrefslogtreecommitdiff
path: root/src/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/url.c')
-rw-r--r--src/url.c11
1 files changed, 10 insertions, 1 deletions
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;
+}