X-Git-Url: https://git.danieliu.xyz/?p=dmenu.git;a=blobdiff_plain;f=dmenu_path;fp=dmenu_path;h=cd43748d53893465a93ceab91a78ba2a48096418;hp=e725ede43beff1c161d2e04ca10336d9939f2283;hb=dfe95cb5468618b2eb3d53d41e2ec9f4d167f3f9;hpb=8b633bf17de71ffec76b2413c23c01bb705c36b8 diff --git a/dmenu_path b/dmenu_path index e725ede..cd43748 100755 --- a/dmenu_path +++ b/dmenu_path @@ -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