swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit 11c68566256c055fa153735c1580704b200412e7
parent b24aab1f5362549ea6f0eafecc453424a0cb4e16
Author: uriel@localhost.localdomain <unknown>
Date:   Sat, 28 Jun 2008 04:02:16 +0200

Experimental: allow (non-consecutive) dots in path elements!
Diffstat:
Mbin/controller.rc | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/controller.rc b/bin/controller.rc @@ -1,7 +1,7 @@ #!/usr/local/plan9/bin/rc path=(. ./bin $PLAN9/bin /bin/ /usr/bin) -uri = `{echo -n $REQUEST_URI | sed -e 's/\?.*//; s/[^a-zA-Z0-9_+\-\/]//g' -e '1q'} +uri = `{echo -n $REQUEST_URI | sed -e 's/\?.*//; s/[^a-zA-Z0-9_+\-\/\.]//g; s/\.*/./g;' -e '1q'} ifs='/' { args = `{echo -n $uri} } @@ -150,7 +150,7 @@ fpath=$sitedir for ( i in ('' $args) ) { fpath = $fpath/$i # We don't want blog settings to cascade into posts, note that we are inBlog instead - if ( ! ~ $#blogDirs 0 && ! ~ $body */indexrss */[bB]log */[bB]log/ ) { + if ( ! ~ $#blogDirs 0 && ! ~ $body */index.rss */[bB]log */[bB]log/ ) { inBlog = $blogDirs blogDirs = () } @@ -214,11 +214,11 @@ if(! ~ $REQUEST_URI */index.rss) { } # RSS -if ( ~ $body */[bB]log/indexrss */[bB]log//indexrss && ~ $#blogDirs 0 ) +if ( ~ $body */[bB]log/index.rss */[bB]log//index.rss && ~ $#blogDirs 0 ) blogDirs = `{basename -d $body} -uri = `{echo $uri | sed 's/indexrss$//'} +uri = `{echo $uri | sed 's/index.rss$//'} uri=$baseuri$"uri fn statpost {