diff src/http/modules/ngx_http_rewrite_module.c @ 1236:5e4d3b5d7ad0

use pointer to an array instead of array for inclusive locations inside location
author Igor Sysoev <igor@sysoev.ru>
date Tue, 05 Jun 2007 11:42:59 +0000
parents 942e241c3b88
children 4c43e25d11ea
line wrap: on
line diff
--- a/src/http/modules/ngx_http_rewrite_module.c
+++ b/src/http/modules/ngx_http_rewrite_module.c
@@ -567,15 +567,14 @@ ngx_http_rewrite_if(ngx_conf_t *cf, ngx_
     clcf->name = pclcf->name;
     clcf->noname = 1;
 
-    if (pclcf->locations.elts == NULL) {
-        if (ngx_array_init(&pclcf->locations, cf->pool, 4, sizeof(void *))
-            == NGX_ERROR)
-        {
+    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);
+    clcfp = ngx_array_push(pclcf->locations);
     if (clcfp == NULL) {
         return NGX_CONF_ERROR;
     }