From 43090cf38bb0b6dd9840a52ac4658eaa1e1c38e4 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Thu, 18 Aug 2011 18:36:32 +0200 Subject: [PATCH] zshrc: Make `cd()\ behave with more than one argument --- etc/zsh/zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 } -- 2.1.4