[hackers] diri: new tip (= 18)

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Tue, 30 Jan 2007 16:50:01 +0100

changeset: 18:12a5a67ae80dac49d34346d947cbad352f196659
tag: tip
user: arg_AT_suckless.org
date: Tue Jan 30 16:42:00 2007 +0100
files: remove.rc save.rc
description:
fixed yet another annoyance, more polishing is necessary

diff -r 5eab2645c613 edit.rc
--- a/edit.rc Tue Jan 30 16:21:19 2007 +0100
+++ b/edit.rc Tue Jan 30 15:00:02 2007 +0100
@@ -1,9 +1,7 @@
 #!/usr/local/plan9/bin/rc
 . /var/www/dirirc
 
-if(! test $PATH_INFO || echo $PATH_INFO | grep -v -s '^[a-zA-Z0-9_/]+$'
- || echo $PATH_INFO | grep -v -s '[a-zA-Z0-9]')
-{
+if(test ! $PATH_INFO || echo $PATH_INFO | grep -v -s '^[a-zA-Z0-9_/]+$') {
         echo 'Location: '^$ADDRESS^'/show.rc'
         echo
         exit 0
diff -r 5eab2645c613 history.rc
--- a/history.rc Tue Jan 30 16:21:19 2007 +0100
+++ b/history.rc Tue Jan 30 16:00:01 2007 +0100
@@ -39,9 +39,7 @@ fn printhist {
         }
 }
 
-if(! test $PATH_INFO || echo $PATH_INFO | grep -v -s '^[a-zA-Z0-9_/]+$'
- || echo $PATH_INFO | grep -v -s '[a-zA-Z0-9]' || test ! -f $DIRIDIR^'/'^$PATH_INFO)
-{
+if(test ! $PATH_INFO || echo $PATH_INFO | grep -v -s '^[a-zA-Z0-9_/]+$' || test ! -f $DIRIDIR^'/'^$PATH_INFO) {
         echo 'Location: '^$ADDRESS^'/show.rc'
         echo
         exit 0
diff -r 5eab2645c613 remove.rc
--- a/remove.rc Tue Jan 30 16:21:19 2007 +0100
+++ b/remove.rc Tue Jan 30 16:00:01 2007 +0100
@@ -1,9 +1,7 @@
 #!/usr/local/plan9/bin/rc
 . /var/www/dirirc
 
-if(! test $PATH_INFO || echo $PATH_INFO | grep -v -s '^[a-zA-Z0-9_/]+$'
- || echo $PATH_INFO | grep -v -s '[a-zA-Z0-9]')
-{
+if(test ! $PATH_INFO || echo $PATH_INFO | grep -v -s '^[a-zA-Z0-9_/]+$') {
         echo 'Location: '^$ADDRESS^'/show.rc'
         echo
         exit 0
@@ -23,8 +21,8 @@ if(test $password) {
         if(! ~ $password $HASHPASSWD || test ! $text)
                 escape
         if(test -e $DIRIDIR^'/'^$PATH_INFO) {
- echo /bin/rm -rf $DIRIDIR^'/'^$PATH_INFO^'.diri' >>/tmp/del
- echo /bin/rm -rf $DIRIDIR^'/'^$PATH_INFO >>/tmp/del
+ /bin/rm -rf $DIRIDIR^'/'^$PATH_INFO
+ /bin/rm -rf $DIRIDIR^'/'^$PATH_INFO^'.diri'
         }
         echo 'Location: '^$ADDRESS^'/show.rc'
         echo
diff -r 5eab2645c613 save.rc
--- a/save.rc Tue Jan 30 16:21:19 2007 +0100
+++ b/save.rc Tue Jan 30 16:00:01 2007 +0100
@@ -1,9 +1,7 @@
 #!/usr/local/plan9/bin/rc
 . /var/www/dirirc
 
-if(! test $PATH_INFO || echo $PATH_INFO | grep -v -s '^[a-zA-Z0-9_/]+$'
- || echo $PATH_INFO | grep -v -s '[a-zA-Z0-9]')
-{
+if(test ! $PATH_INFO || echo $PATH_INFO | grep -v -s '^[a-zA-Z0-9_/]+$') {
         echo 'Location: '^$ADDRESS^'/show.rc'
         echo
         exit 0
@@ -26,7 +24,7 @@ if not
 if not
         escape
 
-if(! ~ $password $HASHPASSWD || ! test $text)
+if(! ~ $password $HASHPASSWD || test ! $text)
         escape
 
 /bin/mkdir -p $DIRIDIR^'/'^`{basename -d $PATH_INFO}
Received on Tue Jan 30 2007 - 16:50:01 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:54:46 UTC