summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2011-11-05 00:59:13 +0200
committerVille Skyttä <ville.skytta@iki.fi>2011-11-05 00:59:13 +0200
commitbfa8425a4a31c0f2948107440b0e351dee90c2d8 (patch)
tree661fc237f37148611b50c1bfcdf93c9ac43fb29f
parent333a5a50bebcbea3f0655351b2f7c57ea195c04a (diff)
downloadbash-completion-bfa8425a4a31c0f2948107440b0e351dee90c2d8.tar.gz
_known_hosts_real: Don't offer hostnames containing wildcards.
-rw-r--r--bash_completion2
-rw-r--r--test/fixtures/_known_hosts_real/known_hosts22
2 files changed, 2 insertions, 2 deletions
diff --git a/bash_completion b/bash_completion
index 3bfbf724..02527690 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 b0926a40..2eb4d4f7 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