~ubuntu-branches/ubuntu/quantal/epiphany-extensions/quantal

« back to all changes in this revision

Viewing changes to extensions/adblock/ad-uri-tester.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2009-09-18 14:08:05 UTC
  • mfrom: (1.1.36 upstream)
  • Revision ID: james.westby@ubuntu.com-20090918140805-fa8kka5uo6u5l5io
Tags: 2.27.92-0ubuntu1
* new upstream 2.27.92 ships ships epiphany-webkit extensions only
  - update debian/control - move from epiphany-browser to -webkit
  - update debian/rules - drop link creation that tried to support -browser
    and -webkit parts and run dh_pysupport on epiphany-webkit dir
  - update debian/rules - use really-all extensions
  - add debian/patches/02_greasemonkey_web_view.patch - fix greasemonkey
    extension being broken by bad web_view lookup - bgo 595814

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *  along with this program; if not, write to the Free Software
16
16
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
17
 *
18
 
 *  $Id$
19
18
 */
20
19
 
21
20
#include "config.h"
23
22
#include "ad-uri-tester.h"
24
23
#include "adblock-pattern.h"
25
24
 
26
 
#include <pcre.h>
27
 
 
28
25
#include "ephy-file-helpers.h"
29
26
#include "ephy-debug.h"
30
27
 
97
94
 
98
95
static gboolean
99
96
match_uri (const char *pattern,
100
 
           const pcre *preg,
 
97
           const GRegex *regex,
101
98
           const UriWithLen *uri_with_len)
102
99
{
103
 
        int ret;
104
 
 
105
 
        ret = pcre_exec (preg, NULL, uri_with_len->uri, uri_with_len->len,
106
 
                         0, PCRE_NO_UTF8_CHECK, NULL, 0);
107
 
 
108
 
        if (ret >= 0)
 
100
        gboolean match;
 
101
 
 
102
        match = g_regex_match (regex, uri_with_len->uri, 0, NULL);
 
103
 
 
104
        if (match)
109
105
        {
110
106
                LOG ("Blocking '%s' with pattern '%s'",
111
107
                     uri_with_len->uri, pattern);