The use of $* prevents correctly cd'ing into a directory with spaces in its path name since each segment of the name around the space is treated as if it is a separate argument.
Example:
"dir/path with spaces" is treated as dir/path and with and spaces. This causes cd to fail. It also causes __gvm_oldcd to fail, although call to builtin cd will succeed.
Same issue happens if path is specified as dir/path\ with\ spaces.
This patch fixes this issue by using "$@" to correctly handle spaces.
Speaking as a GVM noob, why does it need to override the built-in cd function anyways? As the presence of this subtle error shows, that seems rather unwise.
The use of
$*
prevents correctly cd'ing into a directory with spaces in its path name since each segment of the name around the space is treated as if it is a separate argument.Example:
"dir/path with spaces"
is treated asdir/path
andwith
andspaces
. This causescd
to fail. It also causes__gvm_oldcd
to fail, although call tobuiltin cd
will succeed.Same issue happens if path is specified as
dir/path\ with\ spaces
.This patch fixes this issue by using "$@" to correctly handle spaces.
Fixes #457