]> granicus.if.org Git - apache/commitdiff
Replace literal constant with AP_MAX_REG_MATCH
authorStefan Fritsch <sf@apache.org>
Tue, 18 Oct 2011 20:51:35 +0000 (20:51 +0000)
committerStefan Fritsch <sf@apache.org>
Tue, 18 Oct 2011 20:51:35 +0000 (20:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1185849 13f79535-47bb-0310-9956-ffa450edef68

modules/metadata/mod_headers.c

index 961d26aae257190133799c2cdb8ee0099894be44..52102f2296fd84301cad2e12d567015a0d77031c 100644 (file)
@@ -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;