Skip to content

Commit

Permalink
zshrc: check for DIRSTACK{SIZE,FILE} in chpwd()
Browse files Browse the repository at this point in the history
If the environment variables are unset chpwd emmits an
error message, so check before using.

Thanks: Frank Terbeck <ft@grml.org> for review
  • Loading branch information
mika committed Feb 3, 2014
1 parent 57254cb commit 85825da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions etc/zsh/zshrc
Expand Up @@ -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
Expand Down

0 comments on commit 85825da

Please sign in to comment.