diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-11-11 23:58:09 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-11-11 23:58:09 +0300 |
commit | 2a3f4908056a2cf19eab57cd00c0537fa7622482 (patch) | |
tree | 0c597749798af8ebeed5a2bc7c93976025662590 /src/http | |
parent | 656f663caa03b0318a0d46ff9f312422826c04f2 (diff) |
nginx-0.1.6-RELEASE importrelease-0.1.6
*) Bugfix: some location directive combinations with the regular
expressions caused the wrong configuration choose.
Diffstat (limited to 'src/http')
-rw-r--r-- | src/http/ngx_http_core_module.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 7e8cf6903..29a6f76fc 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -992,6 +992,11 @@ static int ngx_cmp_locations(const void *one, const void *two) return 1; } + if (!first->regex && second->regex) { + /* shift the regex matches to the end */ + return -1; + } + if (first->regex || second->regex) { /* do not sort the regex matches */ return 0; @@ -1061,8 +1066,7 @@ static char *ngx_location_block(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) if (cf->args->nelts == 3) { if (value[1].len == 1 && value[1].data[0] == '=') { - clcf->name.len = value[2].len; - clcf->name.data = value[2].data; + clcf->name = value[2]; clcf->exact_match = 1; } else if ((value[1].len == 1 && value[1].data[0] == '~') @@ -1098,8 +1102,7 @@ static char *ngx_location_block(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) } } else { - clcf->name.len = value[1].len; - clcf->name.data = value[1].data; + clcf->name = value[1]; } pclcf = pctx->loc_conf[ngx_http_core_module.ctx_index]; |