]> git.kaiwu.me - nginx.git/commitdiff
Sub filter: fixed matching for a single character.
authorValentin Bartenev <vbart@nginx.com>
Mon, 25 Aug 2014 12:08:55 +0000 (16:08 +0400)
committerValentin Bartenev <vbart@nginx.com>
Mon, 25 Aug 2014 12:08:55 +0000 (16:08 +0400)
src/http/modules/ngx_http_sub_filter_module.c

index 5e6e038bfe9f5e6ae3ee3b6687fe5d7d12ac78ec..e6a34a763b9ab3c45d770b7fc0fd0c45ecdb0ceb 100644 (file)
@@ -546,6 +546,14 @@ ngx_http_sub_parse(ngx_http_request_t *r, ngx_http_sub_ctx_t *ctx)
 
             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;