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

Valentin V. Bartenev vbart at nginx.com
Wed May 8 01:08:17 UTC 2013


On Thursday 02 May 2013 14:32:51 Piotr Sikora wrote:
> # 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>
> 

Nice catch, thank you. I will push it after Maxim Dounin's acknowledgment.

  wbr, Valentin V. Bartenev


> 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