/etc/zsh/zshrc: check for present directory inside dirstack code before switching... 0.3.4
authorMichael Prokop <mika@grml.org>
Wed, 23 May 2007 08:22:56 +0000 (10:22 +0200)
committerMichael Prokop <mika@grml.org>
Wed, 23 May 2007 08:22:56 +0000 (10:22 +0200)
debian/changelog
etc/zsh/zshrc

index 1580439..926ae6b 100644 (file)
@@ -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 <mika@grml.org>  Wed, 23 May 2007 10:22:14 +0200
+
 grml-etc-core (0.3.3) unstable; urgency=low
 
   * /etc/skel/.zshrc:
index b119e24..6b71d16 100644 (file)
@@ -3,7 +3,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # 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