Xinqi Bao's Git
projects
/
dmenu.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
made dmenu_path the way anydot proposed in response to Jukka
[dmenu.git]
/
dmenu_path
diff --git
a/dmenu_path
b/dmenu_path
index
e590a5c
..
cd43748
100755
(executable)
--- a/
dmenu_path
+++ b/
dmenu_path
@@
-1,22
+1,17
@@
#!/bin/sh
CACHE=$HOME/.dmenu_cache
#!/bin/sh
CACHE=$HOME/.dmenu_cache
-UPTODATE=1
IFS=:
IFS=:
-if test ! -f $CACHE
-then
- unset UPTODATE
-fi
-
-if test $UPTODATE
-then
- for dir in $PATH
- do
- test $dir -nt $CACHE && unset UPTODATE
- done
-fi
+uptodate() {
+ test ! -f $CACHE && return 1
+ for dir in $PATH
+ do
+ test $dir -nt $CACHE && return 1
+ done
+ return 0
+}
-if
test ! $UPTODATE
+if
! uptodate
then
for dir in $PATH
do
then
for dir in $PATH
do