comparison 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
comparison
equal deleted inserted replaced
4782:e23892a0c917 4783:2220ce29b9d3
834 834
835 if (ngx_prefix) { 835 if (ngx_prefix) {
836 len = ngx_strlen(ngx_prefix); 836 len = ngx_strlen(ngx_prefix);
837 p = ngx_prefix; 837 p = ngx_prefix;
838 838
839 if (!ngx_path_separator(*p)) { 839 if (len && !ngx_path_separator(p[len - 1])) {
840 p = ngx_pnalloc(cycle->pool, len + 1); 840 p = ngx_pnalloc(cycle->pool, len + 1);
841 if (p == NULL) { 841 if (p == NULL) {
842 return NGX_ERROR; 842 return NGX_ERROR;
843 } 843 }
844 844