[hackers] diri: new tip (= 56)

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Wed, 07 Feb 2007 12:20:02 +0100

changeset: 56:203df845d560
tag: tip
user: arg_AT_suckless.org
date: Wed Feb 07 12:14:36 2007 +0100
files: LICENSE show.rc
description:
added Kris to LICENSE, applied Kris cleanup for the menu function

diff -r 54cf4c41522e -r 203df845d560 LICENSE
--- a/LICENSE Tue Feb 06 11:06:45 2007 +0100
+++ b/LICENSE Wed Feb 07 12:14:36 2007 +0100
@@ -1,6 +1,7 @@ MIT/X Consortium License
 MIT/X Consortium License
 
 (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
+(C)opyright MMVII Kris Maglione <<bsdaemon at comcast dot net>
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the "Software"),
diff -r 54cf4c41522e -r 203df845d560 show.rc
--- a/show.rc Tue Feb 06 11:06:45 2007 +0100
+++ b/show.rc Wed Feb 07 12:14:36 2007 +0100
@@ -9,23 +9,18 @@ fn menu {
                 /^([a-zA-Z0-9_]+[\/*]?)+$/ {
                         isdir = match($0, "/$");
                         sub("[*/]$", "");
- file = bname = $0;
- sub("^(.*/)", "", file);
+ bname = $0;
                         sub("^(.*/)?([0-9]+_)?", "", bname);
                         gsub("_", " ", bname);
                         if(isdir)
                                 bname = bname "/"
- sub("[^/]+$", "")
- path = $0 file
- ispath = match(ENVIRON["PATH_INFO"]"/", "^"path);
- if(isdir && ispath) {
- print "<li><a href=\"" urlbase path "\" class=\"current\">" bname "</a>"
- system("rc -c ''menu " path "''");
- }
- else if(ispath)
- print "<li><a href=\"" urlbase path "\" class=\"current\">" bname "</a>"
- else
- print "<li><a href=\"" urlbase path "\">" bname "</a>"
+
+ if(ispath = match(ENVIRON["PATH_INFO"]"/", "^"$0)) {
+ print "<li><a href=\"" urlbase $0 "\" class=\"current\">" bname "</a>"
+ if(isdir)
+ system("rc -c ''menu " $0 "''");
+ }else
+ print "<li><a href=\"" urlbase $0 "\">" bname "</a>"
                         print "</li>"
                 }' | awk '{ print "\t" $0 }'
 }
Received on Wed Feb 07 2007 - 12:20:02 UTC

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