cd: Add test for changing to a dir starting with a - char

This commit is contained in:
jalr 2019-10-08 21:29:48 +02:00 committed by Fabian Homborg
parent 2e6ab0b418
commit 3d1e9423c2

View File

@ -76,6 +76,12 @@ set -g CDPATH ./
cd $base
test $PWD = $base; and echo No crash with ./ CDPATH
# test for directories beginning with a hyphen
mkdir $base/-testdir
cd $base
cd -- -testdir
test $PWD = $base/-testdir
# cd back before removing the test directory again.
cd $oldpwd
rm -Rf $base