aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-05-26 15:33:55 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-05-26 15:33:55 +1200
commit2eb610513889b2c9653c4481647007f189f98096 (patch)
treec241f8a550badbcf074482d41add84a57e884bf6
parentEmulate zsh dir replacement feature (diff)
downloaddotfiles-2eb610513889b2c9653c4481647007f189f98096.tar.gz
dotfiles-2eb610513889b2c9653c4481647007f189f98096.zip
Handle null arguments to cd
-rw-r--r--bash/bashrc4
1 files changed, 3 insertions, 1 deletions
diff --git a/bash/bashrc b/bash/bashrc
index b65f86ff..c062e20c 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -152,8 +152,10 @@ alias diff='diff -u'
function cd {
if [[ -n "$2" ]]; then
builtin cd "${PWD/$1/$2}"
+ elif [[ -n "$1" ]]; then
+ builtin cd "$1"
else
- builtin cd "$*"
+ builtin cd
fi
}