diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-07-25 14:29:05 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-07-25 14:29:05 +0000 |
commit | 96eaa05fd2523995f95d7410d5d8a48f76e5bca1 (patch) | |
tree | d7e9e08cedf59151e6d91d6e69a8857b408e7090 /src/http/modules/ngx_http_autoindex_module.c | |
parent | 6df67879a0a020262e514dace0c0349742800cd1 (diff) | |
download | nginx-96eaa05fd2523995f95d7410d5d8a48f76e5bca1.tar.gz nginx-96eaa05fd2523995f95d7410d5d8a48f76e5bca1.zip |
fix utf-8 names in autoindex
Diffstat (limited to 'src/http/modules/ngx_http_autoindex_module.c')
-rw-r--r-- | src/http/modules/ngx_http_autoindex_module.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c index b5b6ef7f3..64b29a8b3 100644 --- a/src/http/modules/ngx_http_autoindex_module.c +++ b/src/http/modules/ngx_http_autoindex_module.c @@ -135,7 +135,7 @@ ngx_http_autoindex_handler(ngx_http_request_t *r) { u_char *last, *filename, scale; off_t length; - size_t len, copy, allocated, root; + size_t len, utf_len, allocated, root; ngx_tm_t tm; ngx_err_t err; ngx_buf_t *b; @@ -412,15 +412,16 @@ ngx_http_autoindex_handler(ngx_http_request_t *r) len = entry[i].utf_len; - if (entry[i].name.len - len) { + if (entry[i].name.len != len) { if (len > NGX_HTTP_AUTOINDEX_NAME_LEN) { - copy = NGX_HTTP_AUTOINDEX_NAME_LEN - 3 + 1; + utf_len = NGX_HTTP_AUTOINDEX_NAME_LEN - 3 + 1; } else { - copy = NGX_HTTP_AUTOINDEX_NAME_LEN + 1; + utf_len = NGX_HTTP_AUTOINDEX_NAME_LEN + 1; } - b->last = ngx_utf_cpystrn(b->last, entry[i].name.data, copy); + b->last = ngx_utf_cpystrn(b->last, entry[i].name.data, + utf_len, entry[i].name.len + 1); last = b->last; } else { |