From: Michael Prokop Date: Wed, 23 May 2007 08:22:56 +0000 (+0200) Subject: /etc/zsh/zshrc: check for present directory inside dirstack code before switching... X-Git-Tag: 0.3.4 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;h=refs%2Ftags%2F0.3.4;p=grml-etc-core.git /etc/zsh/zshrc: check for present directory inside dirstack code before switching between directories. --- diff --git a/debian/changelog b/debian/changelog index 1580439..926ae6b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-etc-core (0.3.4) unstable; urgency=low + + * /etc/zsh/zshrc: check for present directory inside dirstack + code before switching between directories. + + -- Michael Prokop Wed, 23 May 2007 10:22:14 +0200 + grml-etc-core (0.3.3) unstable; urgency=low * /etc/skel/.zshrc: diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index b119e24..6b71d16 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3,7 +3,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Die Mai 15 10:53:41 CEST 2007 [mika] +# Latest change: Mit Mai 23 10:22:10 CEST 2007 [mika] ################################################################################ # This file is sourced only for interactive shells. It # should contain commands to set up aliases, functions, @@ -448,7 +448,7 @@ fi if [[ -f ~/.zdirs ]] && [[ ${#dirstack[*]} -eq 0 ]]; then dirstack=( ${(uf)"$(< ~/.zdirs)"} ) # "cd -" won't work after login by just setting $OLDPWD, so - cd $dirstack[0] && cd $OLDPWD + [[ -d $dirstack[0] ]] && cd $dirstack[0] && cd $OLDPWD fi chpwd() { builtin dirs -pl >! ~/.zdirs