From c5e3e37d6d5e07f76339bbeb2a41d814082218a6 Mon Sep 17 00:00:00 2001 From: ljw Date: Wed, 13 May 2026 13:30:50 +0800 Subject: [PATCH 1/2] Suppress [error opening dir] by remove quote around . --- bashttpd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bashttpd b/bashttpd index 9ed8d21..b387060 100755 --- a/bashttpd +++ b/bashttpd @@ -184,7 +184,7 @@ serve_dir_with_tree() [[ $tree_vers == v1.6* ]] && tree_opts="--du" send_response_ok_exit < \ - <(tree -H "$2" -L 1 "$tree_opts" -D "$dir") + <(tree -H "$2" -L 1 $tree_opts -D "$dir") } serve_dir_with_ls() From 7a27c5e052a9dee77fad2db4d6d2393cb707e3d1 Mon Sep 17 00:00:00 2001 From: ljw Date: Wed, 13 May 2026 13:35:01 +0800 Subject: [PATCH 2/2] truncate the tail / of path before passed to tree -H-H --- bashttpd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bashttpd b/bashttpd index b387060..20f495e 100755 --- a/bashttpd +++ b/bashttpd @@ -184,7 +184,7 @@ serve_dir_with_tree() [[ $tree_vers == v1.6* ]] && tree_opts="--du" send_response_ok_exit < \ - <(tree -H "$2" -L 1 $tree_opts -D "$dir") + <(tree -H "${2%%/}" -L 1 $tree_opts -D "$dir") } serve_dir_with_ls()