From: Michael Prokop Date: Mon, 3 Feb 2014 13:49:34 +0000 (+0100) Subject: zshrc: check for DIRSTACK{SIZE,FILE} in chpwd() X-Git-Tag: v0.9.3~1 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=85825da48abac0bf3426f42dad5aa5a01c4d42c3 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 --- 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