aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/bashrc.d/cd.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index fa027e52..6644bd1a 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -12,16 +12,16 @@ cd() {
dirs=("${dirs[@]}" "$arg")
fi
done
- if ((${#dirs} == 2)); then
+ if ((${#dirs[@]} == 2)); then
if [[ $PWD == *"${dirs[0]}"* ]]; then
builtin cd "${opts[@]}" \
- "${PWD/${dirs[0]}/${dirs[1]}}"
+ -- "${PWD/${dirs[0]}/${dirs[1]}}"
else
printf '%s\n' 'bash: cd: could not replace substring' >&2
return 1
fi
else
- builtin cd "${opts[@]}" "${dirs[@]}"
+ builtin cd "${opts[@]}" -- "${dirs[@]}"
fi
}