mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
Fix cd function to handle empty variables correctly. Patch by Sven Axelsson.
darcs-hash:20090201222058-ac50b-31a7ee2db9f68729c21ba153e1439cbeabff84ce.gz
This commit is contained in:
parent
4f54da3795
commit
1123467991
|
@ -14,7 +14,7 @@ function cd --description "Change directory"
|
|||
set -l previous $PWD
|
||||
|
||||
if test $argv[1] = - ^/dev/null
|
||||
if test $__fish_cd_direction = next ^/dev/null
|
||||
if test "$__fish_cd_direction" = next ^/dev/null
|
||||
nextd
|
||||
else
|
||||
prevd
|
||||
|
@ -25,7 +25,7 @@ function cd --description "Change directory"
|
|||
builtin cd $argv[1]
|
||||
set -l cd_status $status
|
||||
|
||||
if test $cd_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
|
||||
|
|
Loading…
Reference in New Issue
Block a user