From: Frank Terbeck Date: Wed, 9 Mar 2011 10:15:38 +0000 (+0100) Subject: Make sure grmlzshrc is only loaded once X-Git-Tag: v0.4.00~8 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=1dda332ef8a0fe126318794e6680e469e586835f Make sure grmlzshrc is only loaded once It may happen, that /etc/zsh/zshrc and ~/.zshrc are both the same file, in which case everything is loaded twice. This should fix the issue. --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index b56cd09..f9d51b2 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -103,6 +103,14 @@ # *all* aliases, for example, use @@INSERT-aliases-all@@. #}}} +# Only load once +[[ ${(t)GRML} != *association* ]] && typeset -gA GRML +if (( ${GRML[ZSHRC_LOADED]} )); then + return 0 +else + GRML[ZSHRC_LOADED]=1 +fi + # zsh profiling {{{ # just execute 'ZSH_PROFILE_RC=1 zsh' and run 'zprof' to get the details if [[ $ZSH_PROFILE_RC -gt 0 ]] ; then