prevailing rule is *

This commit is contained in:
Tim Ruehsen 2014-03-28 22:02:42 +01:00
parent 619959db7a
commit 535751b6cc
2 changed files with 3 additions and 8 deletions

View File

@ -261,6 +261,9 @@ int psl_is_public(const psl_ctx_t *psl, const char *domain)
if (rule) {
// definitely a match, no matter if the found rule is a wildcard or not
return 0;
} else if (suffix.nlabels == 1) {
// unknown TLD, this is the prevailing '*' match
return 0;
}
label_bak = suffix.label;

View File

@ -123,14 +123,6 @@ static void test_psl(void)
if (*p > 0 && isupper(*p))
*p = tolower(*p);
// there are test cases with 'example' unlisted TLD, unsure how to handle these, so skip for the moment
{
size_t len;
if ((len = strlen(domain)) >= 7 && !strcmp(domain + len - 7, "example"))
continue;
}
if (!strcmp(expected_regdom, "null"))
test(psl, domain, NULL);
else