httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1185849 - /httpd/httpd/trunk/modules/metadata/mod_headers.c
Date Tue, 18 Oct 2011 20:51:36 GMT
Author: sf
Date: Tue Oct 18 20:51:35 2011
New Revision: 1185849

URL: http://svn.apache.org/viewvc?rev=1185849&view=rev
Log:
Replace literal constant with AP_MAX_REG_MATCH

Modified:
    httpd/httpd/trunk/modules/metadata/mod_headers.c

Modified: httpd/httpd/trunk/modules/metadata/mod_headers.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_headers.c?rev=1185849&r1=1185848&r2=1185849&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_headers.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_headers.c Tue Oct 18 20:51:35 2011
@@ -572,17 +572,16 @@ static char* process_tags(header_entry *
 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;



Mime
View raw message