[ditz-talk] [PATCH] don't pollute global namespace with local variables

Christian Garbs mitch at cgarbs.de
Mon Aug 11 16:50:47 EDT 2008


---
 contrib/completion/ditz.bash |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/completion/ditz.bash b/contrib/completion/ditz.bash
index 4f43e21..4a17c72 100644
--- a/contrib/completion/ditz.bash
+++ b/contrib/completion/ditz.bash
@@ -6,15 +6,15 @@
 
 _ditz() 
 {
-    cur=${COMP_WORDS[COMP_CWORD]}
+    local cur=${COMP_WORDS[COMP_CWORD]}
     if [ $COMP_CWORD -eq 1 ]; then
 	COMPREPLY=( $( compgen -W "$(ditz --commands)" -- $cur ) )
     elif [ $COMP_CWORD -eq 2 ]; then
-	cmd=${COMP_WORDS[1]}
+	local cmd=${COMP_WORDS[1]}
 	COMPREPLY=( $( compgen -W "$(ditz "$cmd" '<options>' 2>/dev/null)" -- $cur ) )
     elif [ $COMP_CWORD -eq 3 ]; then
-	cmd=${COMP_WORDS[1]}
-	parm1=${COMP_WORDS[2]}
+	local cmd=${COMP_WORDS[1]}
+	local parm1=${COMP_WORDS[2]}
 	COMPREPLY=( $( compgen -W "$(ditz "$cmd" "$parm1" '<options>' 2>/dev/null)" -- $cur ) )
     fi 
 }
-- 
1.5.6.3




More information about the ditz-talk mailing list