aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <joshua.lock@intel.com>2013-04-11 12:08:39 -0700
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-18 08:24:56 +0300
commit089b53650f34e160a0af6be2d856f4449f93e577 (patch)
treefda706f884bd99096815eb754982bb514f636803
parentd5281014f67964fba324153c8cad4a2ec9dc2f3e (diff)
downloadpacrunner-089b53650f34e160a0af6be2d856f4449f93e577.tar.gz
Fix isInNet() to work with non-Mozilla JS interpreters
The isInNet() function relies on being able to call a regex as a function, which is invalid syntax in v8 and JSC. Modify isInNet to use the standard exec() method of the RegExpObject to test for a match.
-rw-r--r--src/javascript.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/javascript.h b/src/javascript.h
index c1d141e..d48bd0c 100644
--- a/src/javascript.h
+++ b/src/javascript.h
@@ -15,7 +15,7 @@
" return result;\n" \
"}\n" \
"function isInNet(ipaddr, pattern, maskstr) {\n" \
-" var test = /^(\\d{1,4})\\.(\\d{1,4})\\.(\\d{1,4})\\.(\\d{1,4})$/(ipaddr);\n" \
+" var test = /^(\\d{1,4})\\.(\\d{1,4})\\.(\\d{1,4})\\.(\\d{1,4})$/.exec(ipaddr);\n" \
" if (test == null) {\n" \
" ipaddr = dnsResolve(ipaddr);\n" \
" if (ipaddr == null)\n" \