Make reading ssh files case-insensitive

Fixes #2843
This commit is contained in:
Fabian Homborg 2016-03-22 11:09:36 +01:00
parent 2e0205a746
commit a81bd697a8

View file

@ -26,9 +26,9 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
if test -r $file
# Print hosts from system wide ssh configuration file
# Note the non-capturing group to avoid printing "name"
string match -r '\s*Host(?:name)? \w.*' < $file | string replace -r '^\s*Host(?:name)?\s*(\S+)' '$1'
set known_hosts $known_hosts (string match -r '^\s*UserKnownHostsFile|^\s*GlobalKnownHostsFile' <$file \
| string replace -r '.*KnownHostsFile\s*' '')
string match -ri '\s*Host(?:name)? \w.*' < $file | string replace -ri '^\s*Host(?:name)?\s*(\S+)' '$1'
set known_hosts $known_hosts (string match -ri '^\s*UserKnownHostsFile|^\s*GlobalKnownHostsFile' <$file \
| string replace -ri '.*KnownHostsFile\s*' '')
end
end
for file in $known_hosts