diff --git a/CHANGES b/CHANGES index f0235ca7..ab1ede1b 100644 --- a/CHANGES +++ b/CHANGES @@ -175,8 +175,7 @@ bash-completion (1.x) * Added setting COMP_KNOWN_HOSTS_WITH_HOSTFILE. _known_hosts_real() will add hosts from HOSTFILE, unless COMP_KNOWN_HOSTS_WITH_HOSTFILE is set to an empty value (Alioth: #311821) - * Fix _known_hosts_real() to not glob awk script - thanks to Eric Blake - (Alioth #311614) + * Quoted $cur to prevent globbing - thanks to Eric Blake (Alioth #311614) * Fix leaking $muttcmd from mutt completion * Fix completing multiple hosts (Debian: #535585) diff --git a/bash_completion b/bash_completion index 0df496ec..bae3a76b 100644 --- a/bash_completion +++ b/bash_completion @@ -961,7 +961,7 @@ _insmod() # do module parameter completion COMPREPLY=( $( /sbin/modinfo -p ${COMP_WORDS[1]} 2>/dev/null | \ awk '{if ($1 ~ /^parm:/ && $2 ~ /^'$cur'/) { print $2 } \ - else if ($1 !~ /:/ && $1 ~ /^'$cur'/) { print $1 }}' ) ) + else if ($1 !~ /:/ && $1 ~ /^'"$cur"'/) { print $1 }}' ) ) else _modules $(uname -r) fi @@ -1112,7 +1112,7 @@ _ipsec() ;; ranbits) COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \ - -- $cur ) ) + -- "$cur" ) ) ;; setup) COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) ) @@ -1544,7 +1544,7 @@ _look() cur=`_get_cword` if [ $COMP_CWORD = 1 ]; then - COMPREPLY=( $( compgen -W '$(look $cur 2>/dev/null)' ) ) + COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' ) ) fi } && complete -F _look $default look