From fb6dc41fca192a4c88330c11ead8f958e9c92de7 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Tue, 27 Sep 2011 12:19:05 +0200 Subject: [PATCH] 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 --- etc/zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() { -- 2.1.4