diff --git a/CHANGES b/CHANGES index c4ecdf3e..79cf9951 100644 --- a/CHANGES +++ b/CHANGES @@ -38,6 +38,7 @@ bash-completion (2.x) * Add /sbin to $PATH when invoking ifconfig and iwconfig. * Combine dcop and qdbus completions into the latter. * sed usage portability fixes. + * Fix leaking local variables from various completions. [ Freddy Vulto ] * Added _get_pword() helper function, thanks to Sung Pae (Alioth: #312030) diff --git a/bash_completion b/bash_completion index 8692c768..b23fde0a 100644 --- a/bash_completion +++ b/bash_completion @@ -705,10 +705,11 @@ _realcommand() { } -# this function count the number of mandatory args +# This function counts the number of args # _count_args() { + local i args=1 for (( i=1; i < COMP_CWORD; i++ )); do if [[ "${COMP_WORDS[i]}" != -* ]]; then diff --git a/contrib/java b/contrib/java index d1fbdebf..01edc606 100644 --- a/contrib/java +++ b/contrib/java @@ -173,7 +173,7 @@ have javadoc && _javadoc() { COMPREPLY=() - local cur prev + local cur prev classpath cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} diff --git a/contrib/lvm b/contrib/lvm index 290c0a43..8f7da553 100644 --- a/contrib/lvm +++ b/contrib/lvm @@ -978,7 +978,7 @@ complete -F _lvextend lvextend _lvm() { - local prev + local cur COMPREPLY=() cur=`_get_cword`