[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-506-gbfa8425

Ville Skyttä ville.skytta at iki.fi
Fri Nov 4 23:00:03 UTC 2011


The following commit has been merged in the master branch:
commit bfa8425a4a31c0f2948107440b0e351dee90c2d8
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Nov 5 00:59:13 2011 +0200

    _known_hosts_real: Don't offer hostnames containing wildcards.

diff --git a/bash_completion b/bash_completion
index 3bfbf72..0252769 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1419,7 +1419,7 @@ _known_hosts_real()
             sub(" .*$", ""); \
             for (i=1; i<=NF; ++i) { \
             sub("^\\[", "", $i); sub("\\](:[0-9]+)?$", "", $i); \
-            if ($i ~ /'"$awkcur"'/) {print $i} \
+            if ($i !~ /[*?]/ && $i ~ /'"$awkcur"'/) {print $i} \
             }}' "${kh[@]}" 2>/dev/null ) )
         fi
         if [ ${#khd[@]} -gt 0 ]; then
diff --git a/test/fixtures/_known_hosts_real/known_hosts2 b/test/fixtures/_known_hosts_real/known_hosts2
index b0926a4..2eb4d4f 100644
--- a/test/fixtures/_known_hosts_real/known_hosts2
+++ b/test/fixtures/_known_hosts_real/known_hosts2
@@ -1 +1 @@
-two,two2,two3,two4
+two,two2,two3,two*,t?o,two4

-- 
bash-completion



More information about the Bash-completion-commits mailing list