From dad2b9f8927cceebe14763f14a4ac871f4fc4cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 27 May 2023 22:46:01 +0200 Subject: [PATCH] Remove traces of ABP_CSS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- src/tools/gravity-parseList.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/tools/gravity-parseList.c b/src/tools/gravity-parseList.c index 450d37b0..3964cf56 100644 --- a/src/tools/gravity-parseList.c +++ b/src/tools/gravity-parseList.c @@ -29,9 +29,6 @@ // See https://github.com/pi-hole/pi-hole/pull/5240 #define ABP_DOMAIN_REXEX "\\|\\|"SUBDOMAIN_PATTERN"*"TLD_PATTERN"\\^" -// Detects ABP extended CSS selectors ("##", "#!#", "#@#", "#?#") preceded by a letter -#define ABP_CSS_SELECTORS "[a-z]#[$?@]{0,1}#" - // A list of items of common local hostnames not to report as unusable // Some lists (i.e StevenBlack's) contain these as they are supposed to be used as HOST files // but flagging them as unusable causes more confusion than it's worth - so we suppress them from the output @@ -75,7 +72,7 @@ int gravity_parseList(const char *infile, const char *outfile, const char *adlis rewind(fpin); // Compile regular expression to validate domains - regex_t exact_regex, abp_regex, false_positives_regex, abp_css_regex; + regex_t exact_regex, abp_regex, false_positives_regex; if(regcomp(&exact_regex, VALID_DOMAIN_REXEX, REG_EXTENDED) != 0) { printf("%s %s Unable to compile regular expression to validate exact domains\n", @@ -100,14 +97,6 @@ int gravity_parseList(const char *infile, const char *outfile, const char *adlis sqlite3_close(db); return EXIT_FAILURE; } - if(regcomp(&abp_css_regex, ABP_CSS_SELECTORS, REG_EXTENDED) != 0) - { - printf("%s %s Unable to compile regular expression to validate ABP-style domains\n", - over, cross); - fclose(fpin); - sqlite3_close(db); - return EXIT_FAILURE; - } // Begin transaction if(sqlite3_exec(db, "BEGIN TRANSACTION;", NULL, NULL, NULL) != SQLITE_OK) @@ -368,7 +357,6 @@ int gravity_parseList(const char *infile, const char *outfile, const char *adlis regfree(&exact_regex); regfree(&abp_regex); regfree(&false_positives_regex); - regfree(&abp_css_regex); for(unsigned int i = 0; i < invalid_domains_list_len; i++) if(invalid_domains_list[i] != NULL) free(invalid_domains_list[i]);