diff --git a/src/bin/http_of_dir.ml b/src/bin/http_of_dir.ml
index 5a37a34f..1e559d86 100644
--- a/src/bin/http_of_dir.ml
+++ b/src/bin/http_of_dir.ml
@@ -59,11 +59,16 @@ let html_list_dir ~top ~parent d : string =
Printf.bprintf body " (parent directory) \n" p;
end;
Printf.bprintf body "
\n";
+ let hidden_stop = ref 0 in
Array.iteri
(fun i f ->
if is_hidden f && (i=0 || not (is_hidden entries.(i-1))) then (
- Printf.bprintf body " (hidden files)
\n";
- ) else if not (is_hidden f) && i>0 && is_hidden entries.(i-1) then (
+ hidden_stop := i;
+ while !hidden_stop < Array.length entries && is_hidden entries.(!hidden_stop) do
+ incr hidden_stop;
+ done;
+ Printf.bprintf body " (%d hidden files)
\n" (!hidden_stop-i);
+ ) else if i = !hidden_stop then (
Printf.bprintf body " \n";
);
if not @@ contains_dot_dot (d // f) then (