[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 32f22b996acef05d5fe0d6b3f448caf7185e8ddc

Freddy Vulto fvulto at gmail.com
Fri Sep 25 19:32:18 UTC 2009


The following commit has been merged in the master branch:
commit 32f22b996acef05d5fe0d6b3f448caf7185e8ddc
Author: Freddy Vulto <fvulto at gmail.com>
Date:   Fri Sep 25 21:30:45 2009 +0200

    Quoted $cur to prevent quoting
    See Alioth #311614, bash-completion.patch3

diff --git a/CHANGES b/CHANGES
index f0235ca..ab1ede1 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 0df496e..bae3a76 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

-- 
bash-completion



More information about the Bash-completion-commits mailing list