From: Frank Terbeck Date: Tue, 27 Sep 2011 10:19:05 +0000 (+0200) Subject: zshrc: Do not use bogus array index `0' in dirstack code [Closes: issue1055] X-Git-Tag: v0.4.02~20 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;ds=sidebyside;h=fb6dc41fca192a4c88330c11ead8f958e9c92de7;p=grml-etc-core.git zshrc: Do not use bogus array index `0' in dirstack code [Closes: issue1055] Instead, use `1' which is the correct way to address the first item of an array in zsh (with the default settings and the ones we are using). Reported-by: Daniel Hahler Signed-off-by: Frank Terbeck --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 5d908f0..f5088f6 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1077,7 +1077,7 @@ DIRSTACKFILE=${DIRSTACKFILE:-${HOME}/.zdirs} if [[ -f ${DIRSTACKFILE} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then dirstack=( ${(f)"$(< $DIRSTACKFILE)"} ) # "cd -" won't work after login by just setting $OLDPWD, so - [[ -d $dirstack[0] ]] && cd $dirstack[0] && cd $OLDPWD + [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD fi chpwd() {