diff src/http/modules/ngx_http_autoindex_module.c @ 1627:bf5521329069

fix autoindex for "alias /"
author Igor Sysoev <igor@sysoev.ru>
date Thu, 08 Nov 2007 15:21:54 +0000
parents 090e391f53db
children 2a92804f4109 d7d3a72c07d8
line wrap: on
line diff
--- a/src/http/modules/ngx_http_autoindex_module.c
+++ b/src/http/modules/ngx_http_autoindex_module.c
@@ -181,7 +181,10 @@ ngx_http_autoindex_handler(ngx_http_requ
     }
 
     allocated = path.len;
-    path.len = last - path.data - 1;
+    path.len = last - path.data;
+    if (path.len > 1) {
+        path.len--;
+    }
     path.data[path.len] = '\0';
 
     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,