[PATCH] PCRE: retain input pattern for all regular expressions

Piotr Sikora piotr at cloudflare.com
Thu May 2 10:32:51 UTC 2013


# HG changeset patch
# User Piotr Sikora <piotr at cloudflare.com>
# Date 1367490396 25200
# Node ID c6434a8634386be8b9bfb90be47c4902a009b36b
# Parent  886800caf36081e1fcbecd0483abeefbafc781b3
PCRE: retain input pattern for all regular expressions.

Previously, input pattern was kept only for regular expressions
with named captures, which resulted in error log entries without
input pattern for PCRE errors that occured while processing
regular expressions without them.

Signed-off-by: Piotr Sikora <piotr at cloudflare.com>

diff -r 886800caf360 -r c6434a863438 src/http/ngx_http_variables.c
--- a/src/http/ngx_http_variables.c     Mon Apr 29 18:58:58 2013 +0400
+++ b/src/http/ngx_http_variables.c     Thu May 02 03:26:36 2013 -0700
@@ -2257,6 +2257,7 @@

     re->regex = rc->regex;
     re->ncaptures = rc->captures;
+    re->name = rc->pattern;

     cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
     cmcf->ncaptures = ngx_max(cmcf->ncaptures, re->ncaptures);
@@ -2274,7 +2275,6 @@

     re->variables = rv;
     re->nvariables = n;
-    re->name = rc->pattern;

     size = rc->name_size;



More information about the nginx-devel mailing list