diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-05-24 14:14:13 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-05-24 14:14:13 +0000 |
commit | e55988c06941931d60241fb40c7e878cf5484ddf (patch) | |
tree | 8b02d15279950c3e41e31ea05ecc5219461f672c /src/http/modules/ngx_http_rewrite_module.c | |
parent | 5cdc511fcd825c522340742f005302d3d7d87771 (diff) | |
download | nginx-e55988c06941931d60241fb40c7e878cf5484ddf.tar.gz nginx-e55988c06941931d60241fb40c7e878cf5484ddf.zip |
locations tree
Diffstat (limited to 'src/http/modules/ngx_http_rewrite_module.c')
-rw-r--r-- | src/http/modules/ngx_http_rewrite_module.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c index 341e05424..9c3d3fb28 100644 --- a/src/http/modules/ngx_http_rewrite_module.c +++ b/src/http/modules/ngx_http_rewrite_module.c @@ -524,7 +524,7 @@ ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ngx_conf_t save; ngx_http_module_t *module; ngx_http_conf_ctx_t *ctx, *pctx; - ngx_http_core_loc_conf_t *clcf, *pclcf, **clcfp; + ngx_http_core_loc_conf_t *clcf, *pclcf; ngx_http_script_if_code_t *if_code; ngx_http_rewrite_loc_conf_t *nlcf; @@ -567,21 +567,10 @@ ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) clcf->name = pclcf->name; clcf->noname = 1; - if (pclcf->locations == NULL) { - pclcf->locations = ngx_array_create(cf->pool, 2, sizeof(void *)); - if (pclcf->locations == NULL) { - return NGX_CONF_ERROR; - } - } - - clcfp = ngx_array_push(pclcf->locations); - if (clcfp == NULL) { + if (ngx_http_add_location(cf, &pclcf->locations, clcf) != NGX_OK) { return NGX_CONF_ERROR; } - *clcfp = clcf; - - if (ngx_http_rewrite_if_condition(cf, lcf) != NGX_CONF_OK) { return NGX_CONF_ERROR; } |