Add TLDs to (DAFSA) data to allow skipping the star rule

This commit is contained in:
Tim Rühsen 2018-02-21 20:49:26 +01:00
parent 49707dc3b3
commit aaacdae977
2 changed files with 1 additions and 5 deletions

View File

@ -586,8 +586,6 @@ def parse_psl(infile, utf_mode, codecs):
flags = PSL_FLAG_WILDCARD | PSL_FLAG_PLAIN | section flags = PSL_FLAG_WILDCARD | PSL_FLAG_PLAIN | section
line = line[2:] line = line[2:]
else: else:
if not b'.' in line:
continue # we do not need an explicit plain TLD rule, already covered by implicit '*' rule
psl_nsuffixes += 1 psl_nsuffixes += 1
flags = PSL_FLAG_PLAIN | section flags = PSL_FLAG_PLAIN | section

View File

@ -1278,8 +1278,6 @@ psl_ctx_t *psl_load_fp(FILE *fp)
psl->nwildcards++; psl->nwildcards++;
psl->nsuffixes++; psl->nsuffixes++;
} else { } else {
if (!strchr(p, '.'))
continue; /* we do not need an explicit plain TLD rule, already covered by implicit '*' rule */
suffix.flags = _PSL_FLAG_PLAIN | type; suffix.flags = _PSL_FLAG_PLAIN | type;
psl->nsuffixes++; psl->nsuffixes++;
} }
@ -1895,7 +1893,7 @@ static int _insert_file(const char *fname, const char **psl_fname, time_t *psl_m
* - location specified during built-time (filename from ./configure --with-psl-distfile) * - location specified during built-time (filename from ./configure --with-psl-distfile)
* - built-in PSL data (generated from ./configure --with-psl-file) * - built-in PSL data (generated from ./configure --with-psl-file)
* - location of built-in data (filename from ./configure --with-psl-file) * - location of built-in data (filename from ./configure --with-psl-file)
* *
* If none of the above is available, the function returns %NULL. * If none of the above is available, the function returns %NULL.
* *
* To free the allocated resources, call psl_free(). * To free the allocated resources, call psl_free().