changeset 5810:5322be87fc02

Sub filter: fixed matching for a single character.
author Valentin Bartenev <vbart@nginx.com>
date Mon, 25 Aug 2014 16:08:55 +0400
parents bb26f7ceaaf1
children f5b612019042
files src/http/modules/ngx_http_sub_filter_module.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_sub_filter_module.c
+++ b/src/http/modules/ngx_http_sub_filter_module.c
@@ -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;