X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=5d908f023731ee2887726b5f376997e732e16bf7;hb=43090cf38bb0b6dd9840a52ac4658eaa1e1c38e4;hp=a34b1703c4feee3e6b0fabb2ed0a96b2c154ebde;hpb=bf69b33d88d8637fecfd70aab30a1de98a7b7878;p=grml-etc-core.git 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 }