aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/cd.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-05 23:50:25 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-05 23:50:25 +1200
commitabfe43a8878d2c7195682f821178cfd6ff2057e2 (patch)
treee058cd2fa5653807da26973f3edc41c0d7c9b75c /bash/bashrc.d/cd.bash
parentMore thorough quoting (diff)
downloaddotfiles-abfe43a8878d2c7195682f821178cfd6ff2057e2.tar.gz
dotfiles-abfe43a8878d2c7195682f821178cfd6ff2057e2.zip
Initialise cd options to empty string
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r--bash/bashrc.d/cd.bash3
1 files changed, 2 insertions, 1 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index 35900b7f..256acadd 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -1,9 +1,10 @@
# If given two arguments to cd, replace the first with the second in $PWD,
# emulating a Zsh function that I often find useful; preserves options too
__cd() {
+ local opts=
while getopts lPe opt
do
- local opts="$opts -$opt"
+ opts="$opts -$opt"
done
shift $(($OPTIND-1))
if [[ $# -eq 2 ]]; then