]> git.kaiwu.me - nginx.git/commitdiff
Merge of r4784: fixed the -p parameter handling.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 24 Sep 2012 18:50:25 +0000 (18:50 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 24 Sep 2012 18:50:25 +0000 (18:50 +0000)
Ensure that the path supplied always ends with a `/' except when empty.
An empty value now corresponds to the current directory instead of `/'.

src/core/nginx.c

index f21e77d30ad12a36fd795c70f3dc780a10df463b..c7f84fd67fa581d3a28da6c750878c92459f0f28 100644 (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;