changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > werc / changeset: Fix minor cosmetic bug in dir listing by passing req_path instead of local_path.

changeset 356: 21d4d464fdef
parent 355: 80ecc1f8e78c
child 357: be5fe6949481
author: uriel@engel.se.cat-v.org
date: Fri, 23 Jan 2009 17:48:09 +0100
files: bin/werc.rc
description: Fix minor cosmetic bug in dir listing by passing req_path instead of local_path.
     1.1--- a/bin/werc.rc	Fri Jan 23 16:46:48 2009 +0100
     1.2+++ b/bin/werc.rc	Fri Jan 23 17:48:09 2009 +0100
     1.3@@ -78,10 +78,9 @@
     1.4 
     1.5 fn dir_listing_handler {
     1.6     d=`{basename -d $1}
     1.7-    # XXX $d is based on $local_path, but should display only req_path here.
     1.8     echo $d|sed 's,.*//,,g; s,/$,,; s,/, / ,g; s,.*,<h1 class="dir-list-head">&</h1> <ul class="dir-list">,'
     1.9     # Symlinks suck: '/.' forces ls to list the linked dir if $d is a symlink.
    1.10-    ls -F $dir_listing_ls_opts $d/. | sed $dirfilter$dirclean' s,.*/([^/]+/?)$,<li><a href="\1">\1</a></li>,'
    1.11+    ls -F $dir_listing_ls_opts $sitedir$d/. | sed $dirfilter$dirclean' s,.*/([^/]+/?)$,<li><a href="\1">\1</a></li>,'
    1.12     echo '</ul>'
    1.13 }
    1.14 
    1.15@@ -108,7 +107,7 @@
    1.16         { } # We are done
    1.17     # Dir listing
    1.18     if not if(~ $local_path */index)
    1.19-        handler_body_main=(dir_listing_handler $local_path)
    1.20+        handler_body_main=(dir_listing_handler $req_path)
    1.21     # Canonize explicit .html urls, the web server might handle this first!
    1.22     if not if(~ $local_path *.html && test -f $local_path)
    1.23         perm_redirect `{ echo $req_path|sed 's/.html$//' }