diff options
author | Igor Sysoev <igor@sysoev.ru> | 2010-05-31 14:41:54 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2010-05-31 14:41:54 +0000 |
commit | a5eefbc17467bf2eeb1f4aa6c43dfdc7a684a6ab (patch) | |
tree | 4a396f2539617d5b0b94c88cc2b48c379aaa9917 /src/http/ngx_http_core_module.c | |
parent | 34ab21c53ad39ef96d9fb1dcc4d6e9fc5a72f4a6 (diff) | |
download | nginx-a5eefbc17467bf2eeb1f4aa6c43dfdc7a684a6ab.tar.gz nginx-a5eefbc17467bf2eeb1f4aa6c43dfdc7a684a6ab.zip |
fix handling an inherited alias in inclusive location
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r-- | src/http/ngx_http_core_module.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index f7c44849c..af035cc03 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -1152,7 +1152,7 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r, tf = clcf->try_files; - alias = clcf->alias ? clcf->name.len : 0; + alias = clcf->alias; for ( ;; ) { @@ -1756,7 +1756,7 @@ ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path, clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - alias = clcf->alias ? clcf->name.len : 0; + alias = clcf->alias; if (alias && !r->valid_location) { ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, @@ -3604,16 +3604,15 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ngx_http_core_loc_conf_t *clcf = conf; ngx_str_t *value; - ngx_uint_t alias, n; + ngx_int_t alias; + ngx_uint_t n; ngx_http_script_compile_t sc; alias = (cmd->name.len == sizeof("alias") - 1) ? 1 : 0; if (clcf->root.data) { - /* the (ngx_uint_t) cast is required by gcc 2.7.2.3 */ - - if ((ngx_uint_t) clcf->alias == alias) { + if ((clcf->alias != 0) == alias) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "\"%V\" directive is duplicate", &cmd->name); @@ -3659,7 +3658,7 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) return NGX_CONF_ERROR; } - clcf->alias = alias; + clcf->alias = alias ? clcf->name.len : 0; clcf->root = value[1]; if (!alias && clcf->root.data[clcf->root.len - 1] == '/') { |