completions/ant: Replace bogus realpath usage

This used `realpath -eq`, which for GNU realpath:

1. Suppresses "most error messages" (-q)
2. Requires that all parts exist (rather than allowing the last not
to)

Since we don't actually need a real path here, just filter.

Fixes #9099
This commit is contained in:
Fabian Boehm 2022-08-25 19:00:29 +02:00
parent a42a651d0a
commit ec8a7d09c6

View file

@ -49,10 +49,8 @@ function __fish_complete_ant_targets -d "Print list of targets from build.xml an
end
set -l tokens $argv
set -l buildfile (realpath -eq $buildfile (__get_buildfile $tokens))
if test $status -ne 0
return 1 # return nothing if buildfile does not exist
end
set -l buildfile (__get_buildfile $tokens | path filter)
or return 1 # return nothing if buildfile does not exist
__get_ant_targets_from_projecthelp $buildfile
end