Skip '+' sign in adblock rules

This commit is contained in:
Alexander Butenko 2010-06-30 11:48:37 -04:00 committed by Christian Dywan
parent 0d5a18b69c
commit 3d972f11e4

View file

@ -1059,6 +1059,8 @@ adblock_fixup_regexp (gchar* src)
case '^': case '^':
g_string_append (str, ""); g_string_append (str, "");
break; break;
case '+':
break;
default: default:
g_string_append_printf (str,"%c", *src); g_string_append_printf (str,"%c", *src);
break; break;
@ -1407,6 +1409,7 @@ test_adblock_parse (void)
g_assert (!adblock_parse_line ("##")); g_assert (!adblock_parse_line ("##"));
g_assert (!adblock_parse_line ("[")); g_assert (!adblock_parse_line ("["));
g_assert_cmpstr (adblock_parse_line ("+advert/"), ==, "advert/");
g_assert_cmpstr (adblock_parse_line ("*foo"), ==, "foo"); g_assert_cmpstr (adblock_parse_line ("*foo"), ==, "foo");
g_assert_cmpstr (adblock_parse_line ("f*oo"), ==, "f.*oo"); g_assert_cmpstr (adblock_parse_line ("f*oo"), ==, "f.*oo");
g_assert_cmpstr (adblock_parse_line ("?foo"), ==, "\\?foo"); g_assert_cmpstr (adblock_parse_line ("?foo"), ==, "\\?foo");