support global exception rules (untested) - surf-adblock - Surf adblock web extension
 (HTM) git clone git://git.codemadness.org/surf-adblock
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 13facacc65a3b7895f171618c0e031a437ec53b3
 (DIR) parent 2b628faccbbc89cc5e6a73029b7131929e51f4fb
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Sun,  4 Jun 2017 18:41:38 +0200
       
       support global exception rules (untested)
       
       Diffstat:
         M adblock.c                           |      11 +++++++----
       
       1 file changed, 7 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/adblock.c b/adblock.c
       @@ -904,6 +904,7 @@ init(void)
        {
                struct filterrule *r;
                FILE *fp;
       +        const char *s;
                char filepath[PATH_MAX], *e;
                size_t len;
                int n;
       @@ -952,10 +953,12 @@ init(void)
                                cleanup();
                                return;
                        }
       -                len = sizeof("{display:none;}") - 1;
       -                if (string_append(&globalcss, "{display:none;}", len) < len) {
       -                        weprintf("cannot append css rule "
       -                                 "to global css selectors\n");
       +
       +                s = r->isexception ? "{display:initial;}" : "{display:none;}";
       +                len = strlen(s);
       +                if (string_append(&globalcss, s, len) < len) {
       +                        weprintf("cannot append CSS rule "
       +                                 "to global CSS selectors\n");
                                cleanup();
                                return;
                        }