From: William A. Rowe Jr Date: Wed, 4 Apr 2012 18:19:19 +0000 (+0000) Subject: * core: Fix building against external PCRE 8.30. X-Git-Tag: 2.2.23~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b065353fd9aeb86521de52f6090c4c7693fe27f8;p=thirdparty%2Fapache%2Fhttpd.git * core: Fix building against external PCRE 8.30. PCRE has removed long deprecated pcre_info(). Use pcre_fullinfo() instead which is present as a replacement since PCRE 3.0 so would also be OK when building with bundled PCRE. http://people.apache.org/~rjung/patches/pcre-httpd-2_2_x.patch small indent change and explicit apr_size_t cast by wrowe PR 52623 Backports: r1243176 Reviewed by: rjung, jorton, wrowe git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1309513 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index a5753c3e059..53b98b851e4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.23 - + *) core: Fix building against PCRE 8.30 by switching from the obsolete + pcre_info() to pcre_fullinfo(). PR 52623 [Ruediger Pluem, Rainer Jung] Changes with Apache 2.2.22 diff --git a/STATUS b/STATUS index b5236ffd94b..34cf61abc57 100644 --- a/STATUS +++ b/STATUS @@ -114,20 +114,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: +1: rjung, rpluem, jorton -1: - * core: Fix building against external PCRE 8.30. - PCRE has removed long deprecated pcre_info(). Use pcre_fullinfo() - instead which is present as a replacement since PCRE 3.0 so - would also be OK when building with bundled PCRE. - PR 52623. - Trunk patch: - http://svn.apache.org/viewvc?rev=r1243176&view=rev - 2.4.x patch: - http://svn.apache.org/viewvc?rev=r1243177&view=rev - Backport version for 2.2.x of patch: - http://people.apache.org/~rjung/patches/pcre-httpd-2_2_x.patch - +1: rjung, jorton, wrowe - (Style nit; PCRE_... is indented one char too much) - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/server/util_pcre.c b/server/util_pcre.c index c69c978503c..980c7869c73 100644 --- a/server/util_pcre.c +++ b/server/util_pcre.c @@ -128,6 +128,7 @@ AP_DECLARE(int) ap_regcomp(ap_regex_t *preg, const char *pattern, int cflags) const char *errorptr; int erroffset; int options = 0; +int nsub; if ((cflags & AP_REG_ICASE) != 0) options |= PCRE_CASELESS; if ((cflags & AP_REG_NEWLINE) != 0) options |= PCRE_MULTILINE; @@ -137,7 +138,9 @@ preg->re_erroffset = erroffset; if (preg->re_pcre == NULL) return AP_REG_INVARG; -preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL); +pcre_fullinfo((const pcre *)preg->re_pcre, NULL, + PCRE_INFO_CAPTURECOUNT, &nsub); +preg->re_nsub = (apr_size_t)nsub; return 0; }