comparison src/core/nginx.c @ 4851:6173853dd782 stable-1.2

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 `/'.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 24 Sep 2012 18:50:25 +0000
parents 834049edae24
children 173cd5458281
comparison
equal deleted inserted replaced
4850:e74c39b69ebe 4851:6173853dd782
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