diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-04-27 15:32:33 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-04-27 15:32:33 +0400 |
commit | 5ef370df40b46b431f2c65d5a35d79569c647fc8 (patch) | |
tree | 8ef57a278e29261bcf160c9ab3fc248cfd674cf1 /src/core/ngx_conf_file.c | |
parent | df585ef949c801d15a915c380583a60f032754b5 (diff) |
-p and --prefix=
Diffstat (limited to 'src/core/ngx_conf_file.c')
-rw-r--r-- | src/core/ngx_conf_file.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index 9b0f67cd1..ea35515a3 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -798,10 +798,6 @@ ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name, ngx_uint_t conf_prefix) u_char *p, *prefix; ngx_str_t old; - if (name->data[0] == '/') { - return NGX_OK; - } - #if (NGX_WIN32) if (name->len > 2 @@ -812,17 +808,23 @@ ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name, ngx_uint_t conf_prefix) return NGX_OK; } +#else + + if (name->data[0] == '/') { + return NGX_OK; + } + #endif old = *name; if (conf_prefix) { - len = sizeof(NGX_CONF_PREFIX) - 1; - prefix = (u_char *) NGX_CONF_PREFIX; + len = cycle->conf_prefix.len; + prefix = cycle->conf_prefix.data; } else { - len = cycle->root.len; - prefix = cycle->root.data; + len = cycle->prefix.len; + prefix = cycle->prefix.data; } name->len = len + old.len; @@ -851,7 +853,7 @@ ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name) full.data = NULL; #endif - if (name) { + if (name && name->len) { full = *name; if (ngx_conf_full_name(cycle, &full, 0) != NGX_OK) { @@ -887,7 +889,7 @@ ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name) return NULL; } - if (name) { + if (name && name->len) { file->fd = NGX_INVALID_FILE; file->name = full; |