You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2012/03/29 21:24:05 UTC

svn commit: r1307067 - /httpd/httpd/trunk/server/util.c

Author: sf
Date: Thu Mar 29 19:24:04 2012
New Revision: 1307067

URL: http://svn.apache.org/viewvc?rev=1307067&view=rev
Log:
Fix treatment of regex backreferences.

r904765 only made half of the necessary changes to remove the use
of '&' as an alias for '$0' and allow to escape any character with a
backslash.

Modified:
    httpd/httpd/trunk/server/util.c

Modified: httpd/httpd/trunk/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1307067&r1=1307066&r2=1307067&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util.c (original)
+++ httpd/httpd/trunk/server/util.c Thu Mar 29 19:24:04 2012
@@ -437,15 +437,13 @@ static apr_status_t regsub_core(apr_pool
     src = input;
 
     while ((c = *src++) != '\0') {
-        if (c == '&')
-            no = 0;
-        else if (c == '$' && apr_isdigit(*src))
+        if (c == '$' && apr_isdigit(*src))
             no = *src++ - '0';
         else
             no = AP_MAX_REG_MATCH;
 
         if (no >= AP_MAX_REG_MATCH) {  /* Ordinary character. */
-            if (c == '\\' && (*src == '$' || *src == '&'))
+            if (c == '\\' && *src)
                 c = *src++;
             *dst++ = c;
         }