[hackers] [dmenu] made dmenu_path the way anydot proposed in response to Jukka

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Wed May 23 22:14:21 2007

changeset: 202:8d92d29eddd5
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Wed May 23 22:13:46 2007 +0200
summary: made dmenu_path the way anydot proposed in response to Jukka

diff -r 96f3661df2fe -r 8d92d29eddd5 dmenu_path
--- a/dmenu_path Wed May 23 13:22:27 2007 +0200
+++ b/dmenu_path Wed May 23 22:13:46 2007 +0200
@@ -1,22 +1,15 @@
 #!/bin/sh
 CACHE=$HOME/.dmenu_cache
-UPTODATE=1
 IFS=:
 
-uptodate() { [ $UPTODATE -eq 1 ]; }
-
-if test ! -f $CACHE
-then
- UPTODATE=0
-fi
-
-if uptodate
-then
- for dir in $PATH
- do
- test $dir -nt $CACHE && { UPTODATE=0; break; }
- done
-fi
+uptodate() {
+ test ! -f $CACHE && return 1
+ for dir in $PATH
+ do
+ test $dir -nt $CACHE && return 1
+ done
+ return 0
+}
 
 if ! uptodate
 then
Received on Wed May 23 2007 - 22:14:21 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:47 UTC