cd: fix path when trying to cd out of the root directory

Part of #12704
This commit is contained in:
Nahor
2026-04-30 11:30:16 -07:00
committed by Johannes Altmanninger
parent d885e0efd7
commit 4f539dffaf
2 changed files with 15 additions and 1 deletions

View File

@@ -407,3 +407,10 @@ cd (string repeat 4096 a)
# CHECKERR: ^
# CHECKERR: in function 'cd' with arguments '{{.*}}'
# CHECKERR: called on line {{\d+}} of file {{.*}}/cd.fish
# Ensures `cd` doesn't create `<pwd>+/+<dir>` internally, when pwd is `/`, i.e.
# results in `//<dir>`. This test will (hopefully) fail on platforms where such
# a path has a special meaning (e.g. Windows would fail trying to access a server
# named "bin")
cd /
cd bin