From 85825da48abac0bf3426f42dad5aa5a01c4d42c3 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 3 Feb 2014 14:49:34 +0100 Subject: [PATCH] zshrc: check for DIRSTACK{SIZE,FILE} in chpwd() If the environment variables are unset chpwd emmits an error message, so check before using. Thanks: Frank Terbeck for review --- etc/zsh/zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index bd8ab85..1af7ed7 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1556,6 +1556,7 @@ if [[ -f ${DIRSTACKFILE} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then fi chpwd() { + if (( $DIRSTACKSIZE <= 0 )) || [[ -z $DIRSTACKFILE ]]; then return; fi local -ax my_stack my_stack=( ${PWD} ${dirstack} ) if is42 ; then -- 2.1.4