_known_hosts_real: Discard @markers at beginning of line.
This commit is contained in:
parent
55ec6a079b
commit
b54d3f022f
@ -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 ) )
|
||||
|
2
test/fixtures/_known_hosts_real/known_hosts
vendored
2
test/fixtures/_known_hosts_real/known_hosts
vendored
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user