Merge of r4784: 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 `/'.
This commit is contained in:
Maxim Dounin 2012-09-24 18:50:25 +00:00
parent 38df2aa726
commit e1e56351f1
1 changed files with 1 additions and 1 deletions

View File

@ -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;