From 7e735ba4a7e4f262323fa6e496d2bfbf998c8417 Mon Sep 17 00:00:00 2001 From: Uriel Date: Sat, 28 Jun 2008 06:07:59 +0200 Subject: [PATCH] Fix coding style --- bin/controller.rc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/controller.rc b/bin/controller.rc index 9069ffc..6e2320e 100755 --- a/bin/controller.rc +++ b/bin/controller.rc @@ -30,7 +30,7 @@ dirfilter = '/\/[._]/d; s,^\.\.*/,.,; s,\.md$,,; s,\.html,,;' # Sidebar fn menu { - lsArgs = ( '-F' ) + lsArgs = ('-F') # XXX will not work properly for $#blogDirs > 1 and matching is hackish if ( (! ~ $#inBlog 0) || ! ~ $#blogDirs 0 && (~ $blogDirs^/ *$1 *$1/) ) { # Work in progress XXX lsArgs = ($lsArgs -r) @@ -88,27 +88,27 @@ fn blogTitle { # Body fn genbody { - if ( test -f $body.md ) { - if ( ! ~ $#inBlog 0 ) + if (test -f $body.md) { + if (! ~ $#inBlog 0) blogTitle $body.md | $formatter $formatter < $body.md } - if not if ( test -f $body.tpl ) + if not if (test -f $body.tpl) template.awk $body.tpl | rc $rcargs - if not if ( test -f $body.txt ) { + if not if (test -f $body.txt) { echo '
'
 	# XXX Insering a blank line between lines in input is good for fortunes.txt, but probably not for other .txt files
 	# XXX Words are not broken, even if they are way beyond 82 chars long
         cat $body.txt |sed 's/$/\n/g; s//\</g' |fmt -l 82 -j
         echo '
' } - if not if ( test -f $body.html ) + if not if (test -f $body.html) cat $body.html | /bin/sed '0,/<[Bb][Oo][Dd][Yy][^>]*>/d; /<\/[Bb][Oo][Dd][Yy]>/,$d' - if not if (~ $body *.html && test -f $body ) + if not if (~ $body *.html && test -f $body) cat $body | /bin/sed -i '0,/]*>/d;/<\/body>/,$d' # This branch is never taken? - if not if ( ~ $body */[bB]log/index */[bB]log//index && ~ $#blogDirs 0 ) + if not if (~ $body */[bB]log/index */[bB]log//index && ~ $#blogDirs 0) blogDirs = `{basename -d $body} - if not if ( test -f pub/^$reqpath^.tpl ) + if not if (test -f pub/^$reqpath^.tpl) template.awk pub/^$reqpath^.tpl | rc $rcargs if not if(~ $body */index && ~ $#blogDirs 0) { echo '

' `{basename -d $body|sed -e 's,.*//,,g' -e 's,/$,,' -e 's,/, / ,g' } '

' @@ -122,10 +122,10 @@ fn genbody { } if(! ~ $#blogDirs 0) { - if ( ! ~ $blogTitle '' ) + if (! ~ $blogTitle '') echo '

'$"blogTitle'

' echo '
(rss feed)
' - for ( f in `{ sortedBlogPostList $blogDirs } ) { + for (f in `{ sortedBlogPostList $blogDirs }) { #title=`{basename $f | sed 's/^[0-9\-]*_(.*)\.md$/\1/; s/_/ /g' } #du=`{ls -l $f} #echo '##' $title '*('By $du(4) Last mod: $du(7 8 9) ')*' @@ -147,18 +147,18 @@ if (! ~ $args '') { } fpath=$sitedir -for ( i in ('' $args) ) { +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 */index.rss */[bB]log */[bB]log/ ) { + if (! ~ $#blogDirs 0 && ! ~ $body */index.rss */[bB]log */[bB]log/) { inBlog = $blogDirs blogDirs = () } - if ( test -f $fpath/_config ) + if (test -f $fpath/_config) . $fpath/_config - if ( ~ $#blogDirs 0 && ~ $#inBlog 0 && ~ $i [Bb]log ) + if (~ $#blogDirs 0 && ~ $#inBlog 0 && ~ $i [Bb]log) inBlog = 'yes' } @@ -214,7 +214,7 @@ if(! ~ $REQUEST_URI */index.rss) { } # RSS -if ( ~ $body */[bB]log/index.rss */[bB]log//index.rss && ~ $#blogDirs 0 ) +if (~ $body */[bB]log/index.rss */[bB]log//index.rss && ~ $#blogDirs 0) blogDirs = `{basename -d $body}