aboutsummaryrefslogtreecommitdiff
path: root/src/core/nginx.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2012-08-03 12:52:32 +0000
committerRuslan Ermilov <ru@nginx.com>2012-08-03 12:52:32 +0000
commit8ed4929a261f64c28c21e42f0f366c8d228fc790 (patch)
treeb95be533c48ddb063a8786d6e66bd4910165895c /src/core/nginx.c
parent25197b32291a35b623077c7f413003081038f4a8 (diff)
downloadnginx-8ed4929a261f64c28c21e42f0f366c8d228fc790.tar.gz
nginx-8ed4929a261f64c28c21e42f0f366c8d228fc790.zip
Fixed the -p parameter handling.
Ensure that the path supplied always ends with a `/' except when empty. An empty value now corresponds to the current directory instead of `/'.
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r--src/core/nginx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index f21e77d30..c7f84fd67 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -836,7 +836,7 @@ ngx_process_options(ngx_cycle_t *cycle)
len = ngx_strlen(ngx_prefix);
p = ngx_prefix;
- if (!ngx_path_separator(*p)) {
+ if (len && !ngx_path_separator(p[len - 1])) {
p = ngx_pnalloc(cycle->pool, len + 1);
if (p == NULL) {
return NGX_ERROR;