[nginx] Sub filter: fixed matching for a single character.

Valentin Bartenev vbart at nginx.com
Mon Aug 25 12:09:28 UTC 2014


details:   http://hg.nginx.org/nginx/rev/5322be87fc02
branches:  
changeset: 5810:5322be87fc02
user:      Valentin Bartenev <vbart at nginx.com>
date:      Mon Aug 25 16:08:55 2014 +0400
description:
Sub filter: fixed matching for a single character.

diffstat:

 src/http/modules/ngx_http_sub_filter_module.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (18 lines):

diff -r bb26f7ceaaf1 -r 5322be87fc02 src/http/modules/ngx_http_sub_filter_module.c
--- a/src/http/modules/ngx_http_sub_filter_module.c	Wed Aug 20 13:13:27 2014 +0400
+++ b/src/http/modules/ngx_http_sub_filter_module.c	Mon Aug 25 16:08:55 2014 +0400
@@ -546,6 +546,14 @@ ngx_http_sub_parse(ngx_http_request_t *r
 
             for ( ;; ) {
                 if (ch == match) {
+
+                    if (ctx->match.len == 1) {
+                        ctx->pos = p + 1;
+                        ctx->copy_end = p;
+
+                        return NGX_OK;
+                    }
+
                     copy_end = p;
                     ctx->looked.data[0] = *p;
                     looked = 1;



More information about the nginx-devel mailing list