Fix a bug in the function wrapper around the 'cd' builtin that caused cd to sometimes return with a non-zero exit status even though the command did not fail

darcs-hash:20060616151848-ac50b-001698980eca6fadf9e470d829a532c305c84e38.gz
This commit is contained in:
axel 2006-06-17 01:18:48 +10:00
parent 907b2f8462
commit 6e0e7e0996

View file

@ -23,13 +23,14 @@ function cd -d (N_ "Change directory")
end
builtin cd $argv[1]
set -l cd_status $status
if test $status = 0 -a $PWD != $previous
if test $cd_status = 0 -a $PWD != $previous
set -g dirprev $dirprev $previous
set -e dirnext
set -g __fish_cd_direction prev
end
return $status
return $cd_status
end