From c1edcb9206003656d2bbbdcaae9609696e1ba1e9 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Fri, 21 Oct 2011 08:41:55 +0800 Subject: [PATCH] Fixed square brackets for zsh_compat and zsh_reset --- lib/scm_breeze.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/scm_breeze.sh b/lib/scm_breeze.sh index f669309..170085e 100644 --- a/lib/scm_breeze.sh +++ b/lib/scm_breeze.sh @@ -3,8 +3,8 @@ if [ -n "${ZSH_VERSION:-}" ]; then shell="zsh"; else shell="bash"; fi # Detect whether zsh 'shwordsplit' option is on by default. if [ $shell = "zsh" ]; then zsh_shwordsplit=$( (setopt | grep -q shwordsplit) && echo "true" ); fi # Switch on/off shwordsplit for functions that require it. -zsh_compat(){ if [ $shell = "zsh" && -z $zsh_shwordsplit ]; then setopt shwordsplit; fi; } -zsh_reset(){ if [ $shell = "zsh" && -z $zsh_shwordsplit ]; then unsetopt shwordsplit; fi; } +zsh_compat(){ if [ $shell = "zsh" ] && [ -z $zsh_shwordsplit ]; then setopt shwordsplit; fi; } +zsh_reset(){ if [ $shell = "zsh" ] && [ -z $zsh_shwordsplit ]; then unsetopt shwordsplit; fi; } # Alias wrapper that ignores errors if alias is not defined. _alias(){ alias "$@" 2> /dev/null; }