diff options
Diffstat (limited to 'usr.sbin/nginx/src/http/ngx_http_script.c')
| -rw-r--r-- | usr.sbin/nginx/src/http/ngx_http_script.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/nginx/src/http/ngx_http_script.c b/usr.sbin/nginx/src/http/ngx_http_script.c index 54d019589a9..02e2be3bb80 100644 --- a/usr.sbin/nginx/src/http/ngx_http_script.c +++ b/usr.sbin/nginx/src/http/ngx_http_script.c @@ -1327,16 +1327,17 @@ ngx_http_script_full_name_code(ngx_http_script_engine_t *e) { ngx_http_script_full_name_code_t *code; - ngx_str_t value; + ngx_str_t value, *prefix; code = (ngx_http_script_full_name_code_t *) e->ip; value.data = e->buf.data; value.len = e->pos - e->buf.data; - if (ngx_conf_full_name((ngx_cycle_t *) ngx_cycle, &value, code->conf_prefix) - != NGX_OK) - { + prefix = code->conf_prefix ? (ngx_str_t *) &ngx_cycle->conf_prefix: + (ngx_str_t *) &ngx_cycle->prefix; + + if (ngx_get_full_name(e->request->pool, prefix, &value) != NGX_OK) { e->ip = ngx_http_script_exit; e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; return; @@ -1393,7 +1394,7 @@ ngx_http_script_if_code(ngx_http_script_engine_t *e) e->sp--; - if (e->sp->len && (e->sp->len !=1 || e->sp->data[0] != '0')) { + if (e->sp->len && (e->sp->len != 1 || e->sp->data[0] != '0')) { if (code->loc_conf) { e->request->loc_conf = code->loc_conf; ngx_http_update_location_config(e->request); |
