mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
__fish_print_hostnames: Use source
instead of eval
Since this doesn't need stdin, we can skip eval's overhead.
This commit is contained in:
parent
4437e8d8d6
commit
57753c7303
1 changed files with 2 additions and 2 deletions
|
@ -32,7 +32,7 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
|
|||
if contains -- '-F' $token
|
||||
set ssh_config_path_is_next 0
|
||||
else if test $ssh_config_path_is_next -eq 0
|
||||
set ssh_config (eval "echo $token")
|
||||
set ssh_config (echo "echo $token" | source)
|
||||
set ssh_config_path_is_next 1
|
||||
end
|
||||
end
|
||||
|
@ -66,7 +66,7 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
|
|||
set -l new_paths
|
||||
for path in $paths
|
||||
set -l expanded_path
|
||||
eval "set expanded_path (printf \"%s\n\" $path)"
|
||||
echo "set expanded_path (printf \"%s\n\" $path)" | source
|
||||
for path in $expanded_path
|
||||
# Resolve "relative" paths in accordance to ssh path resolution
|
||||
if string match -qv '/*' $path
|
||||
|
|
Loading…
Reference in a new issue