only try to autoload, when there actually is s.th. to
[grml-etc-core.git] / etc / zsh / zshrc
index d9e5ac8..48ae2e9 100644 (file)
@@ -616,8 +616,10 @@ isdarwin && xsource /sw/bin/init.sh
 for fdir in /usr/share/grml/zsh/completion /usr/share/grml/zsh/functions; do
     fpath=( ${fdir} ${fdir}/**/*(/N) ${fpath} )
 done
-unset -v fdir
-autoload -U /usr/share/grml/zsh/functions/**/[^_]*[^~](N.:t)
+typeset -aU ffiles
+ffiles=(/usr/share/grml/zsh/functions/**/[^_]*[^~](N.:t))
+(( ${#files} > 0 )) && autoload -U "${ffiles[@]}"
+unset -v fdir ffiles
 
 # support colors in less
 export LESS_TERMCAP_mb=$'\E[01;31m'