[Bash-completion-commits] [bash-completion] 01/01: _known_hosts_real: Exclude %h HostName entries (RedHat: #1015935).

Ville Skyttä scop-guest at alioth.debian.org
Mon Oct 7 17:07:47 UTC 2013


This is an automated email from the git hooks/post-receive script.

scop-guest pushed a commit to branch master
in repository bash-completion.

commit fcc9545b44f32b627f75e1589fb93a5c7ad86bff
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Oct 7 20:06:15 2013 +0300

    _known_hosts_real: Exclude %h HostName entries (RedHat: #1015935).
---
 bash_completion                        |    2 +-
 test/fixtures/_known_hosts_real/config |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/bash_completion b/bash_completion
index 3360873..c684a8f 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1552,7 +1552,7 @@ _known_hosts_real()
 
     # append any available aliases from config files
     if [[ ${#config[@]} -gt 0 && -n "$aliases" ]]; then
-        local hosts=$( sed -ne 's/^['"$'\t '"']*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\{0,1\}['"$'\t '"']\{1,\}\([^#*?]*\)\(#.*\)\{0,1\}$/\2/p' "${config[@]}" )
+        local hosts=$( sed -ne 's/^['"$'\t '"']*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\{0,1\}['"$'\t '"']\{1,\}\([^#*?%]*\)\(#.*\)\{0,1\}$/\2/p' "${config[@]}" )
         COMPREPLY+=( $( compgen -P "$prefix$user" \
             -S "$suffix" -W "$hosts" -- "$cur" ) )
     fi
diff --git a/test/fixtures/_known_hosts_real/config b/test/fixtures/_known_hosts_real/config
index 77770ff..1231dd7 100644
--- a/test/fixtures/_known_hosts_real/config
+++ b/test/fixtures/_known_hosts_real/config
@@ -2,5 +2,6 @@
 
     # Unindented
 Host gee jar
+     HostName %h.example.com
 	# Indented
     Host hus  # With comment

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/bash-completion.git



More information about the Bash-completion-commits mailing list