From 33b98d278e53b4d238f296f47e792485d64b9ce3 Mon Sep 17 00:00:00 2001 From: Uriel Date: Sat, 20 Dec 2008 02:57:01 +0100 Subject: [PATCH] Simplify dir listing handler, and deal better with corner cases. --- bin/werc.rc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/werc.rc b/bin/werc.rc index 7b68924..17f7593 100755 --- a/bin/werc.rc +++ b/bin/werc.rc @@ -21,7 +21,7 @@ fn gentitle { # Don't change var name or trailing ';', dirfilter might be changed from _werc/config! # TODO: Specify the canonical path input format handled by dirfilter -dirfilter = '/\/[._]/d; /'^$forbidden_uri_chars^'/d; /\/(robots\.txt|sitemap\.txt|index\.(md|html|txt|tpl))$/d; /_werc\/?$/d; s,^\./,,; s,\.(md|html|txt)$,,; ' +dirfilter = 's,/\./,/,g; /\/[._]/d; /'^$forbidden_uri_chars^'/d; /\/(robots\.txt|sitemap\.txt|index\.(md|html|txt|tpl))$/d; /_werc\/?$/d; s,^\./,,; s,\.(md|html|txt)$,,; ' # To be used from config files fn hide_paths { @@ -100,9 +100,9 @@ fn txt_handler { fn dir_listing_handler { d = `{basename -d $1} - dt = `{echo $d|sed -e 's,.*//,,g' -e 's,/$,,' -e 's,/, / ,g'} - echo '

'^$"dt^'