From c33a7d6bb7a2314e9d75cdd6d4d90e65314fa259 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 23 May 2007 10:22:56 +0200 Subject: [PATCH] /etc/zsh/zshrc: check for present directory inside dirstack code before switching between directories. --- debian/changelog | 7 +++++++ etc/zsh/zshrc | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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 -- 2.1.4