From: Stefan Fritsch Date: Tue, 18 Oct 2011 20:51:35 +0000 (+0000) Subject: Replace literal constant with AP_MAX_REG_MATCH X-Git-Tag: 2.3.15~114 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9196c6dfd571890378baaaf22c14711d9ab1d1a;p=apache Replace literal constant with AP_MAX_REG_MATCH git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1185849 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/metadata/mod_headers.c b/modules/metadata/mod_headers.c index 961d26aae2..52102f2296 100644 --- a/modules/metadata/mod_headers.c +++ b/modules/metadata/mod_headers.c @@ -572,17 +572,16 @@ static char* process_tags(header_entry *hdr, request_rec *r) static const char *process_regexp(header_entry *hdr, const char *value, apr_pool_t *pool) { - unsigned int nmatch = 10; - ap_regmatch_t pmatch[10]; + ap_regmatch_t pmatch[AP_MAX_REG_MATCH]; const char *subs; const char *remainder; char *ret; int diffsz; - if (ap_regexec(hdr->regex, value, nmatch, pmatch, 0)) { + if (ap_regexec(hdr->regex, value, AP_MAX_REG_MATCH, pmatch, 0)) { /* no match, nothing to do */ return value; } - subs = ap_pregsub(pool, hdr->subs, value, nmatch, pmatch); + subs = ap_pregsub(pool, hdr->subs, value, AP_MAX_REG_MATCH, pmatch); diffsz = strlen(subs) - (pmatch[0].rm_eo - pmatch[0].rm_so); if (hdr->action == hdr_edit) { remainder = value + pmatch[0].rm_eo;