diff src/core/nginx.c @ 4783:2220ce29b9d3

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 `/'.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 03 Aug 2012 12:52:32 +0000
parents 834049edae24
children 173cd5458281
line wrap: on
line diff
--- a/src/core/nginx.c	Fri Aug 03 09:10:39 2012 +0000
+++ b/src/core/nginx.c	Fri Aug 03 12:52:32 2012 +0000
@@ -836,7 +836,7 @@
         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;