From db0a98257046baa7eb3bc78236b07211478fe2b6 Mon Sep 17 00:00:00 2001 From: liljencrantz Date: Sat, 29 Sep 2007 07:38:21 +1000 Subject: [PATCH] Make path checking on startup faster by only using builtin commands darcs-hash:20070928213821-75c98-65fb9e2159bfef7ab04468511378ac3efbf2308e.gz --- share/config.fish.in | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/share/config.fish.in b/share/config.fish.in index c0bfd247f..d0aec60fe 100644 --- a/share/config.fish.in +++ b/share/config.fish.in @@ -62,14 +62,11 @@ switch $USER set path_list $path_list /sbin /usr/sbin /usr/local/sbin end -# Make a regular expression that matches any component in the PATH. A -# trailing slash is ok. The sed call is to remove the last '|'. -set -l tmp (printf "%s" \^$PATH'/?$|') -set -l path_regexp \((echo $tmp | sed -e "s/.\$//")\) - -for i in (printf "%s\n" $path_list|sgrep -E -v $path_regexp) - if test -d $i - set PATH $PATH $i +for i in $path_list + if not contains $i $PATH + if test -d $i + set PATH $PATH $i + end end end