From b54d3f022f73553bdec64e1da29736d41835a029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 5 Nov 2011 00:38:37 +0200 Subject: _known_hosts_real: Discard @markers at beginning of line. --- bash_completion | 6 ++++-- test/fixtures/_known_hosts_real/known_hosts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bash_completion b/bash_completion index 637ca69a..8c8fab59 100644 --- a/bash_completion +++ b/bash_completion @@ -1414,8 +1414,10 @@ _known_hosts_real() if [ ${#kh[@]} -gt 0 ]; then # FS needs to look for a comma separated list COMPREPLY+=( $( awk 'BEGIN {FS=","} - /^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \ - sub(" .*$", "", $i); \ + /^\s*[^|\#]/ { + sub("^@[^ ]+ +", ""); \ + sub(" .*$", ""); \ + for (i=1; i<=2; ++i) { \ sub("^\\[", "", $i); sub("\\](:[0-9]+)?$", "", $i); \ if ($i ~ /'"$awkcur"'/) {print $i} \ }}' "${kh[@]}" 2>/dev/null ) ) diff --git a/test/fixtures/_known_hosts_real/known_hosts b/test/fixtures/_known_hosts_real/known_hosts index f655eaa3..0d6f5025 100644 --- a/test/fixtures/_known_hosts_real/known_hosts +++ b/test/fixtures/_known_hosts_real/known_hosts @@ -3,7 +3,7 @@ doo ike ssh-rsa qwerty1234/Qwerty+1234== jub,10.0.0.1 -kyl,100.0.0.2 +@cert-authority kyl,100.0.0.2 xxxfoo [10.10.0.3]:10022 [blah]:1234 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 -- cgit v1.2.1