fix online upgrade

This commit is contained in:
Igor Sysoev 2007-01-25 21:48:28 +00:00
parent 84a0149f59
commit b0a33d1ae2

View file

@ -423,17 +423,10 @@ ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last)
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
if (last) {
n = *last;
} else {
if (ccf->environment) {
if (last == NULL && ccf->environment) {
return ccf->environment;
}
n = 0;
}
var = ccf->env.elts;
for (i = 0; i < ccf->env.nelts; i++) {
@ -453,6 +446,8 @@ ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last)
tz_found:
n = 0;
for (i = 0; i < ccf->env.nelts; i++) {
if (var[i].data[var[i].len] == '=') {
@ -472,8 +467,8 @@ tz_found:
}
if (last) {
env = ngx_alloc((*last + n + 1) * sizeof(char *), cycle->log);
*last = n;
env = ngx_alloc((n + 1) * sizeof(char *), cycle->log);
} else {
env = ngx_palloc(cycle->pool, (n + 1) * sizeof(char *));