Always use "." for cd

Nobody doesn't want to use $PWD to cd, so if $CDPATH does not include
it that was a mistake.

Bash also appends "." here.

Fixes #4484.
This commit is contained in:
Fabian Homborg
2019-03-26 10:11:36 +01:00
parent eeec6cc2fc
commit b86200938f
6 changed files with 23 additions and 4 deletions

View File

@@ -62,6 +62,16 @@ test (realpath $output_pwd) = $real_getcwd
and echo "BogusPWD test 2 succeeded"
or echo "BogusPWD test 2 failed: $output_pwd vs $real_getcwd"
# $CDPATH
logmsg CDPATH
set -g CDPATH $base
cd linkhome
test $PWD = $base/linkhome; and echo Gone to linkhome via CDPATH
set -g CDPATH /tmp
cd $base
test $PWD = $base; and echo Gone to base
cd linkhome
test $PWD = $base/linkhome; and echo Gone to linkhome via implicit . in CDPATH
# cd back before removing the test directory again.
cd $oldpwd