Skip to content

Commit 5f583b8

Browse files
committed
Update the cd script to work with directory names that include spaces
This patch adds (escaped) quotation marks around the directory argument to the builtin cd so that the user can cd into a directory with spaces in it
1 parent dd65253 commit 5f583b8

File tree

1 file changed

+1
-1
lines changed
  • scripts/env

1 file changed

+1
-1
lines changed

scripts/env/cd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919
if __gvm_is_function cd; then
2020
eval "$(echo "__gvm_oldcd()"; declare -f cd | sed '1 s/{/\'$'\n''{/' | tail -n +2)"
2121
elif [[ "$(builtin type cd)" == "cd is a shell builtin" ]]; then
22-
eval "$(echo "__gvm_oldcd() { builtin cd \$*; return \$?; }")"
22+
eval "$(echo "__gvm_oldcd() { builtin cd \"\$*\"; return \$?; }")"
2323
fi
2424

2525
# Path cleanup

0 commit comments

Comments
 (0)