diff options
author | garga <garga@FreeBSD.org> | 2012-07-05 22:27:30 +0800 |
---|---|---|
committer | garga <garga@FreeBSD.org> | 2012-07-05 22:27:30 +0800 |
commit | 394b0d4d21dca79c399c119f3d99a26fac50f5e6 (patch) | |
tree | e4900e43a6dc96aeb388d8de4c3fd811a2057d96 /www/dansguardian | |
parent | 183c5b776a4a3ac55e20cf9ab8ce6cd680d1ee74 (diff) | |
download | freebsd-ports-gnome-394b0d4d21dca79c399c119f3d99a26fac50f5e6.tar.gz freebsd-ports-gnome-394b0d4d21dca79c399c119f3d99a26fac50f5e6.tar.zst freebsd-ports-gnome-394b0d4d21dca79c399c119f3d99a26fac50f5e6.zip |
- Fix dansguardian to run with new versions of pcre
- Bump PORTREVISION
Submitted by: Anthony Brown <anthony@found-it.net>
Diffstat (limited to 'www/dansguardian')
-rw-r--r-- | www/dansguardian/Makefile | 2 | ||||
-rw-r--r-- | www/dansguardian/files/patch-src__RegEx.cpp | 40 | ||||
-rw-r--r-- | www/dansguardian/files/patch-src__RegExp.hpp | 10 |
3 files changed, 51 insertions, 1 deletions
diff --git a/www/dansguardian/Makefile b/www/dansguardian/Makefile index 370d5db7b65c..e3a57061eaa1 100644 --- a/www/dansguardian/Makefile +++ b/www/dansguardian/Makefile @@ -7,7 +7,7 @@ PORTNAME= dansguardian PORTVERSION= 2.10.1.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= www MASTER_SITES= # empty, see below diff --git a/www/dansguardian/files/patch-src__RegEx.cpp b/www/dansguardian/files/patch-src__RegEx.cpp new file mode 100644 index 000000000000..59c433265200 --- /dev/null +++ b/www/dansguardian/files/patch-src__RegEx.cpp @@ -0,0 +1,40 @@ +--- src/RegExp.cpp.orig 2008-11-18 11:27:04.000000000 +0000 ++++ src/RegExp.cpp 2012-07-05 09:03:46.555469692 +0100 +@@ -161,14 +161,17 @@ + offsets.clear(); + lengths.clear(); + imatched = false; +- regmatch_t *pmatch = new regmatch_t[reg.re_nsub + 1]; // to hold result ++ int num_sub_expressions = MAX_SUB_EXPRESSIONS; ++ if(reg.re_nsub < num_sub_expressions) ++ num_sub_expressions = reg.re_nsub; ++ regmatch_t *pmatch = new regmatch_t[num_sub_expressions + 1]; // to hold result + if (!pmatch) { // if it failed + delete[]pmatch; + imatched = false; + return false; + // exception? + } +- if (regexec(®, pos, reg.re_nsub + 1, pmatch, 0)) { // run regex ++ if (regexec(®, pos, num_sub_expressions + 1, pmatch, 0)) { // run regex + delete[]pmatch; + imatched = false; + // #ifdef DGDEBUG +@@ -182,7 +185,7 @@ + int error = 0; + while (error == 0) { + largestoffset = 0; +- for (i = 0; i <= (signed) reg.re_nsub; i++) { ++ for (i = 0; i <= (signed) num_sub_expressions; i++) { + if (pmatch[i].rm_so != -1) { + matchlen = pmatch[i].rm_eo - pmatch[i].rm_so; + submatch = new char[matchlen + 1]; +@@ -199,7 +202,7 @@ + } + if (largestoffset > 0) { + pos += largestoffset; +- error = regexec(®, pos, reg.re_nsub + 1, pmatch, REG_NOTBOL); ++ error = regexec(®, pos, num_sub_expressions + 1, pmatch, REG_NOTBOL); + } else { + error = -1; + } diff --git a/www/dansguardian/files/patch-src__RegExp.hpp b/www/dansguardian/files/patch-src__RegExp.hpp new file mode 100644 index 000000000000..a16451789087 --- /dev/null +++ b/www/dansguardian/files/patch-src__RegExp.hpp @@ -0,0 +1,10 @@ +--- src/RegExp.hpp.orig 2008-11-18 11:27:04.000000000 +0000 ++++ src/RegExp.hpp 2012-07-05 09:03:46.555469692 +0100 +@@ -22,6 +22,7 @@ + #ifndef __HPP_REGEXP + #define __HPP_REGEXP + ++#define MAX_SUB_EXPRESSIONS 1024 + + // INCLUDES + |