From: martin f. krafft Date: Tue, 6 May 2008 09:01:30 +0000 (+0100) Subject: no need to use IFS with zsh thanks to s.:. X-Git-Url: https://git.madduck.net/etc/zsh.git/commitdiff_plain/4afa3665947686c80bec7da614aa4ffdfe5bd2df?ds=inline;pf=etc no need to use IFS with zsh thanks to s.:. --- diff --git a/.zsh/zshrc/89_dircolors b/.zsh/zshrc/89_dircolors index 8f561f8..d084875 100644 --- a/.zsh/zshrc/89_dircolors +++ b/.zsh/zshrc/89_dircolors @@ -12,14 +12,13 @@ eval $(dircolors $ZDOTDIR/dircolors) 2>/dev/null || : if [ -n "$LS_COLORS" ]; then # uniquify LS_COLORS due to #479544 + typeset -A pairs - IFS_old="$IFS" - IFS=: - for pair in ${=LS_COLORS}; do + for pair in ${(s.:.)LS_COLORS}; do [ -z "${pair%%\=*}" ] && continue pairs["${pair%%\=*}"]="${pair#*=}" done - IFS="$IFS_old" + typeset -a items for key in ${(k)pairs}; do [ "$pairs[$key]" = 00 ] && continue #removes styles handled by normal