Introduction
Introduction Statistics Contact Development Disclaimer Help
Style consistency fixes around bin/aux/* and bin/contrib/* - swerc - anselm's s…
git clone git://git.suckless.org/swerc
Log
Files
Refs
README
---
commit d0a02720c629f40d787023fdd4276eded59fcfc8
parent 9a5efd4b9586132544e5b56003cfb0eab8db0341
Author: [email protected] <unknown>
Date: Sun, 21 Dec 2008 00:13:53 +0100
Style consistency fixes around bin/aux/* and bin/contrib/*
Diffstat:
M bin/aux/bpst.rc | 20 ++++++++++----------
M bin/aux/gensitemaptxt.rc | 2 +-
M bin/contrib/webserver.rc | 20 ++++++++++----------
3 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/bin/aux/bpst.rc b/bin/aux/bpst.rc
@@ -8,38 +8,38 @@ fn die {
exit 1
}
-if (~ $#* 0)
+if(~ $#* 0)
die 'Missing title'
if(~ $#user 0)
- user = `{whoami}
+ user=`{whoami}
-file = (); title = ();
-bloguser = $user
+file=(); title=();
+bloguser=$user
while(! ~ $#* 0) {
switch($1) {
case -u
base=/gsoc/www/people/$user/blog/
shift
case *
- title = $"*
+ title=$"*
}
shift
}
date=`{/bin/date +%F}
-n = 1
+n=1
for(f in $base/$date-*) {
- i = `{echo $f | sed -n 's|^.*/'$date'-([0-9]+)_.*|\1|p'}
+ i=`{echo $f | sed -n 's|^.*/'$date'-([0-9]+)_.*|\1|p'}
if(! ~ $#i 0 && test $i -ge $n)
- n = `{hoc -e $i'+1'}
+ n=`{hoc -e $i'+1'}
}
if(~ $EDITOR '')
- EDITOR = vi
+ EDITOR=vi
-file = $home/.blogtmp.$pid
+file=$home/.blogtmp.$pid
rm $file >[2]/dev/null
touch $file
$EDITOR $file
diff --git a/bin/aux/gensitemaptxt.rc b/bin/aux/gensitemaptxt.rc
@@ -1,7 +1,7 @@
#!/usr/bin/env rc
# DEPRECATED: sitemap.tpl now generates and updates a sitemap.txt when request…
-for ( d in sites/*/ ) {
+for(d in sites/*/) {
echo $d
9 du -a $d | awk '/\.(md|html)$/ { print $2 }; {}' | 9 sed -e 's/\.(md|html)$/…
diff --git a/bin/contrib/webserver.rc b/bin/contrib/webserver.rc
@@ -3,28 +3,28 @@
# A web server in rc by maht
# Originally from http://www.proweb.co.uk/~matt/rc/webserver.rc
-ifs = ' '
-request = `{sed 1q}
+ifs=' '
+request=`{sed 1q}
-url = $request(2)
-file = `{echo $url | sed 's/http:\/\/[^\/]*//' | tr -d \012}
+url=$request(2)
+file=`{echo $url | sed 's/http:\/\/[^\/]*//' | tr -d \012}
if(test -d $file){
- file = $file ^'/index.html'
+ file=$file ^'/index.html'
}
-if (test -e $file) {
- response = '200'
+if(test -e $file) {
+ response='200'
}
if not {
- response = '404'
- file = '404.html'
+ response='404'
+ file='404.html'
}
echo 'HTTP/1.1 ' ^$response
echo 'Date: ' `{date}
echo 'Server: rc shell'
echo 'Content-Length: ' `{cat $file | wc -c | tr -d ' '}
-echo 'Content-Type: ' `{file -i $file | awk ' { print $2 } '}
+echo 'Content-Type: ' `{file -i $file | awk '{ print $2 }'}
echo 'Connection: close'
echo
cat $file
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.