commit 0de2e2ea45dbd28f0155554c0bb4488bb9f431d7
parent 8010a7933060dd5c46255ce599288cab16dbbe87
Author: uriel@engel.se.cat-v.org <unknown>
Date: Mon, 26 Jan 2009 04:51:06 +0100
Handle dir listing of site root.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/bin/werc.rc b/bin/werc.rc
@@ -69,6 +69,8 @@ fn txt_handler {
fn dir_listing_handler {
d=`{basename -d $1}
+ if(~ $#d 0)
+ d='/'
echo $d|sed 's,.*//,,g; s,/$,,; s,/, / ,g; s,.*,<h1 class="dir-list-head">&</h1> <ul class="dir-list">,'
# Symlinks suck: '/.' forces ls to list the linked dir if $d is a symlink.
ls -F $dir_listing_ls_opts $sitedir$d/. | sed $dirfilter$dirclean' s,.*/([^/]+/?)$,<li><a href="\1">\1</a></li>,'