Fix loading of lists from https

Fixes: https://bugs.launchpad.net/midori/+bug/699978
This commit is contained in:
Alexander Butenko 2011-05-12 11:30:26 -04:00 committed by Christian Dywan
parent 0a9420ec32
commit 6885c35886

View file

@ -29,9 +29,9 @@
(__filter && (g_str_has_prefix (__filter, "http") \ (__filter && (g_str_has_prefix (__filter, "http") \
|| g_str_has_prefix (__filter, "file"))) || g_str_has_prefix (__filter, "file")))
#define ADBLOCK_FILTER_SET(__filter,__active) \ #define ADBLOCK_FILTER_SET(__filter,__active) \
filter[4] = __active ? (__filter[5] == ':' ? 's' : ':') : '-' __filter[4] = __active ? (__filter[5] == ':' ? 's' : ':') : '-'
#define ADBLOCK_FILTER_IS_SET(__filter) \ #define ADBLOCK_FILTER_IS_SET(__filter) \
filter[4] != '-' (__filter[4] != '-' && __filter[5] != '-')
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
#define adblock_debug(dmsg, darg1, darg2) \ #define adblock_debug(dmsg, darg1, darg2) \
do { if (debug == 1) g_debug (dmsg, darg1, darg2); } while (0) do { if (debug == 1) g_debug (dmsg, darg1, darg2); } while (0)
@ -119,7 +119,7 @@ adblock_get_filename_for_uri (const gchar* uri)
gchar* folder; gchar* folder;
gchar* path; gchar* path;
if (strchr (uri + 4,'-')) if (!ADBLOCK_FILTER_IS_SET (uri))
return NULL; return NULL;
if (!strncmp (uri, "file", 4)) if (!strncmp (uri, "file", 4))