only try to autoload, when there actually is s.th. to
authorThilo Six <grml@xk2c.de>
Sun, 5 Feb 2017 19:42:57 +0000 (20:42 +0100)
committerFrank Terbeck <ft@grml.org>
Sun, 5 Feb 2017 20:00:09 +0000 (21:00 +0100)
This fixes a regression introduced today: Only try to autoload, when
there actually is s.th. to autoload otherwise "autoload -U" _prints_ all
functions that were marked for autoloading thus far.

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'