aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_autoindex_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-09-30 14:41:25 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-09-30 14:41:25 +0000
commit9fa5a823c467c8ba13f8edff3c7d3c6dc75ea1d4 (patch)
tree7db278ad5da26db878ba05453ac96404fa2df556 /src/http/modules/ngx_http_autoindex_module.c
parentbdf4a89a20b9b2cb91c7c97941a2cb36534e2f9d (diff)
downloadnginx-9fa5a823c467c8ba13f8edff3c7d3c6dc75ea1d4.tar.gz
nginx-9fa5a823c467c8ba13f8edff3c7d3c6dc75ea1d4.zip
nginx-0.2.2-RELEASE importrelease-0.2.2
*) Feature: the "config errmsg" command of the ngx_http_ssi_module. *) Change: the ngx_http_geo_module variables can be overridden by the "set" directive. *) Feature: the "ssl_protocols" and "ssl_prefer_server_ciphers" directives of the ngx_http_ssl_module and ngx_imap_ssl_module. *) Bugfix: the ngx_http_autoindex_module did not show correctly the long file names; *) Bugfix: the ngx_http_autoindex_module now do not show the files starting by dot. *) Bugfix: if the SSL handshake failed then another connection may be closed too. Thanks to Rob Mueller. *) Bugfix: the export versions of MSIE 5.x could not connect via HTTPS.
Diffstat (limited to 'src/http/modules/ngx_http_autoindex_module.c')
-rw-r--r--src/http/modules/ngx_http_autoindex_module.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c
index fb40669ba..d5a6b69ba 100644
--- a/src/http/modules/ngx_http_autoindex_module.c
+++ b/src/http/modules/ngx_http_autoindex_module.c
@@ -271,21 +271,14 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
len = ngx_de_namelen(&dir);
- if (len == 1 && ngx_de_name(&dir)[0] == '.') {
- continue;
- }
-
- if (len == 2
- && ngx_de_name(&dir)[0] == '.'
- && ngx_de_name(&dir)[1] == '.')
- {
+ if (ngx_de_name(&dir)[0] == '.') {
continue;
}
if (!dir.valid_info) {
- if (dname.len + 1 + len > fname.len) {
- fname.len = dname.len + 1 + len + 32;
+ if (dname.len + 1 + len + 1 > fname.len) {
+ fname.len = dname.len + 1 + len + 1 + 32;
fname.data = ngx_palloc(pool, fname.len);
if (fname.data == NULL) {
@@ -468,7 +461,8 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
} else {
if (entry[i].dir) {
- b->last = ngx_cpymem(b->last, " -", sizeof(" -") - 1);
+ b->last = ngx_cpymem(b->last, " -",
+ sizeof(" -") - 1);
} else {
length = entry[i].size;
@@ -498,13 +492,14 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
} else {
size = (ngx_int_t) length;
- scale = ' ';
+ scale = '\0';
}
- b->last = ngx_sprintf(b->last, "%6i", size);
+ if (scale) {
+ b->last = ngx_sprintf(b->last, "%6i%c", size, scale);
- if (scale != ' ') {
- *b->last++ = scale;
+ } else {
+ b->last = ngx_sprintf(b->last, " %6i", size);
}
}
}