From: Frank Terbeck Date: Thu, 18 Aug 2011 16:36:32 +0000 (+0200) Subject: zshrc: Make `cd()\ behave with more than one argument X-Git-Tag: v0.4.02~21 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;h=43090cf38bb0b6dd9840a52ac4658eaa1e1c38e4;hp=bf69b33d88d8637fecfd70aab30a1de98a7b7878;p=grml-etc-core.git zshrc: Make `cd()\ behave with more than one argument --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index a34b170..5d908f0 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -2786,12 +2786,12 @@ fir() { } # smart cd function, allows switching to /etc when running 'cd /etc/fstab' cd() { - if [[ -f ${1} ]]; then + if (( ${#argv} == 1 )) && [[ -f ${1} ]]; then [[ ! -e ${1:h} ]] && return 1 print "Correcting ${1} to ${1:h}" builtin cd ${1:h} else - builtin cd ${1} + builtin cd "$@" fi }