diff -u nginx-1.6.0/src/http/modules/ngx_http_autoindex_module.c nginx-1.6.0/src/http/modules.new/ngx_http_autoindex_module.c
|
old
|
new
|
|
| 40 | 40 | ngx_flag_t enable; |
| 41 | 41 | ngx_flag_t localtime; |
| 42 | 42 | ngx_flag_t exact_size; |
| | 43 | ngx_flag_t show_dot_files; |
| 43 | 44 | } ngx_http_autoindex_loc_conf_t; |
| 44 | 45 | |
| 45 | 46 | |
| … |
… |
|
| 81 | 82 | offsetof(ngx_http_autoindex_loc_conf_t, exact_size), |
| 82 | 83 | NULL }, |
| 83 | 84 | |
| | 85 | { ngx_string("autoindex_show_dot_files"), |
| | 86 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
| | 87 | ngx_conf_set_flag_slot, |
| | 88 | NGX_HTTP_LOC_CONF_OFFSET, |
| | 89 | offsetof(ngx_http_autoindex_loc_conf_t, show_dot_files), |
| | 90 | NULL }, |
| | 91 | |
| 84 | 92 | ngx_null_command |
| 85 | 93 | }; |
| 86 | 94 | |
| … |
… |
|
| 279 | 287 | |
| 280 | 288 | len = ngx_de_namelen(&dir); |
| 281 | 289 | |
| 282 | | if (ngx_de_name(&dir)[0] == '.') { |
| 283 | | continue; |
| 284 | | } |
| | 290 | if (!alcf->show_dot_files) { |
| | 291 | if (ngx_de_name(&dir)[0] == '.') { |
| | 292 | continue; |
| | 293 | } |
| | 294 | } |
| 285 | 295 | |
| 286 | 296 | if (!dir.valid_info) { |
| 287 | 297 | |
| … |
… |
|
| 413 | 423 | |
| 414 | 424 | b->last = ngx_cpymem(b->last, "</h1>", sizeof("</h1>") - 1); |
| 415 | 425 | |
| 416 | | b->last = ngx_cpymem(b->last, "<hr><pre><a href=\"../\">../</a>" CRLF, |
| 417 | | sizeof("<hr><pre><a href=\"../\">../</a>" CRLF) - 1); |
| | 426 | if (!alcf->show_dot_files) { |
| | 427 | b->last = ngx_cpymem(b->last, "<hr><pre><a href=\"../\">../</a>" CRLF, |
| | 428 | sizeof("<hr><pre><a href=\"../\">../</a>" CRLF) - 1); |
| | 429 | } else { |
| | 430 | b->last = ngx_cpymem(b->last, "<hr><pre>" CRLF, |
| | 431 | sizeof("<hr><pre>" CRLF) - 1); |
| | 432 | } |
| 418 | 433 | |
| 419 | 434 | tp = ngx_timeofday(); |
| 420 | 435 | |
| … |
… |
|
| 667 | 682 | conf->enable = NGX_CONF_UNSET; |
| 668 | 683 | conf->localtime = NGX_CONF_UNSET; |
| 669 | 684 | conf->exact_size = NGX_CONF_UNSET; |
| | 685 | conf->show_dot_files = NGX_CONF_UNSET; |
| 670 | 686 | |
| 671 | 687 | return conf; |
| 672 | 688 | } |
| … |
… |
|
| 681 | 697 | ngx_conf_merge_value(conf->enable, prev->enable, 0); |
| 682 | 698 | ngx_conf_merge_value(conf->localtime, prev->localtime, 0); |
| 683 | 699 | ngx_conf_merge_value(conf->exact_size, prev->exact_size, 1); |
| | 700 | ngx_conf_merge_value(conf->show_dot_files, prev->show_dot_files, 0); |
| 684 | 701 | |
| 685 | 702 | return NGX_CONF_OK; |
| 686 | 703 | } |