mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-26 20:21:59 +00:00
fix ./x readdir logic when CDPATH is set
This commit is contained in:
parent
2f4dfc753f
commit
04f6b8f992
3
x
3
x
@ -15,7 +15,8 @@ realpath() {
|
||||
if [ -L "$path" ]; then
|
||||
readlink -f "$path"
|
||||
elif [ -d "$path" ]; then
|
||||
(cd -P "$path" && pwd)
|
||||
# "cd" is not always silent (e.g. when CDPATH is set), so discard its output.
|
||||
(cd -P "$path" >/dev/null && pwd)
|
||||
else
|
||||
echo "$(realpath "$(dirname "$path")")/$(basename "$path")"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user