shithub: werc

Download patch

ref: e58c3bfe91ad473728f2fe77b865247790a7387d
parent: f50734a6f5ebd1c9f08e09d417d9cd4737187661
author: uriel <uriel@engel.se.cat-v.org>
date: Mon Dec 15 22:45:44 EST 2008

Fix and cleanup dir listing regexp.

--- a/bin/werc.rc
+++ b/bin/werc.rc
@@ -125,8 +125,7 @@
     d = `{basename -d $1}
     dt = `{echo $d|sed -e 's,.*//,,g' -e 's,/$,,' -e 's,/, / ,g'} 
     echo '<h1 class="dir-list-head">'^$"dt^'</h1> <ul class="dir-list">'
-    # XXX I'm not sure what the [^$] does there
-    ls -F $d | sed -e 's/\*$//; '^$dirfilter' s,^'$sitedir'/.*/([^$].*),<li><a href="\1">\1</a></li>,'
+    ls -F $d | sed -e 's/\*$//; '^$dirfilter' s,^'$sitedir'/.*/([^/]+/?)$,<li><a href="\1">\1</a></li>,'
     echo '</ul>'
 }