diff options
author | portix <none@none> | 2012-09-07 18:59:50 +0200 |
---|---|---|
committer | portix <none@none> | 2012-09-07 18:59:50 +0200 |
commit | 65cc69060ec99511396a9845214c119ad7d5d9ce (patch) | |
tree | 53b3222b2684212b8709c996935f84ee7223881b /src/adblock.c | |
parent | 618eba0223b44658fb81657a640fa67ae621976c (diff) | |
download | dwb-65cc69060ec99511396a9845214c119ad7d5d9ce.zip |
Allow directories for adblock-filterlist
Diffstat (limited to 'src/adblock.c')
-rw-r--r-- | src/adblock.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/adblock.c b/src/adblock.c index 61f23abb..34b4ce06 100644 --- a/src/adblock.c +++ b/src/adblock.c @@ -545,7 +545,16 @@ adblock_warn_ignored(const char *message, const char *rule) { /* adblock_rule_parse(char *filterlist) {{{*/ static void adblock_rule_parse(char *filterlist) { - char **lines = util_get_lines(filterlist); + char **lines = NULL; + if (g_file_test(filterlist, G_FILE_TEST_IS_DIR)) { + GString *string = g_string_new(NULL); + util_get_directory_content(string, filterlist, NULL); + if (string->str) + lines = g_strsplit(string->str, "\n", -1); + g_string_free(string, true); + } + else + lines = util_get_lines(filterlist); if (lines == NULL) return; char *pattern; |