From b62d9eb63eb5c9a20c4f38a180f339d36c4b5136 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 25 Aug 2016 01:19:50 +0000 Subject: 39103: _typed-in_absolute_command_paths: Better handle non-empty arguments that don't start with a slash. --- Completion/Unix/Type/_absolute_command_paths | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Type') diff --git a/Completion/Unix/Type/_absolute_command_paths b/Completion/Unix/Type/_absolute_command_paths index e9ab17023..4d9f79380 100644 --- a/Completion/Unix/Type/_absolute_command_paths +++ b/Completion/Unix/Type/_absolute_command_paths @@ -16,7 +16,13 @@ _hashed_absolute_command_paths() { # This function completes absolute pathnames of executables, e.g., /etc/rc.local _typed-in_absolute_command_paths() { # TODO: the description "full path to an executable" and tag in the caller are ignored by _path_files - _path_files -/ -g '*(-*)' -P / -W / + if [[ -z $PREFIX ]]; then + _path_files -/ -g '*(-*)' -P / -W / + elif [[ $PREFIX[1] == / ]]; then + _path_files -/ -g '*(-*)' -W / + else + return 1 + fi } _absolute_command_paths() { -- cgit 1.4.1