From: Frank Terbeck Date: Mon, 22 Oct 2007 14:44:55 +0000 (+0200) Subject: zshrc: not using 'for name0 name1 in a b c d ; ...' anymore X-Git-Tag: 0.3.36~1 X-Git-Url: https://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=a55d3a49488ef61c21912f12fba2fc81445b4a02 zshrc: not using 'for name0 name1 in a b c d ; ...' anymore Replacing that contruct with something, that does not break older zshs. --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index c740a02..ba0df24 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -451,12 +451,20 @@ fi done # autoload zsh modules when they are referenced - is4 && for opt mod in a stat \ - a zpty \ - ap zprof \ - ap mapfile ; do - zmodload -${opt} zsh/${mod} ${mod} - done ; unset opt mod + if is4 ; then + tmpargs=( + a stat + a zpty + ap zprof + ap mapfile + ) + + while (( ${#tmpargs} > 0 )) ; do + zmodload -${tmpargs[1]} zsh/${tmpargs[2]} ${tmpargs[2]} + shift 2 tmpargs + done + unset tmpargs + fi is4 && autoload -U insert-files && \ zle -N insert-files && \