# HG changeset patch # User Ruslan Ermilov # Date 1343998352 0 # Node ID 2220ce29b9d301ba665ca478e0cd099573a2d876 # Parent e23892a0c9170226d27b30b5e0312071c699dd76 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 `/'. diff --git a/src/core/nginx.c b/src/core/nginx.c --- 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;