Move executable-check to C++

This was already apparently supposed to work, but didn't because we
just overrode errno again.

This now means that, if a correctly named candidate exists, we don't
start the command-not-found handler.

See #8804
This commit is contained in:
Fabian Homborg
2022-03-31 15:10:45 +02:00
parent 90d52ee669
commit f13979bfbb
5 changed files with 16 additions and 17 deletions

View File

@@ -13,12 +13,6 @@ or set -g __fish_added_user_paths
#
function __fish_default_command_not_found_handler
printf (_ "fish: Unknown command: %s\n") (string escape -- $argv[1]) >&2
for file in $PATH/$argv[1]
if test -e $file -a ! -x $file
printf (_ "fish: %s exists but isn't executable\n") (string escape -- $file) >&2
break
end
end
end