summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index a15d66057..6387a7757 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3103,12 +3103,11 @@ mch_can_exe(char_u *name, char_u **path, int use_path)
/* When "use_path" is false and if it's an absolute or relative path don't
* need to use $PATH. */
- if (!use_path || mch_isFullName(name) || (name[0] == '.'
- && (name[1] == '/' || (name[1] == '.' && name[2] == '/'))))
+ if (!use_path || gettail(name) != name)
{
/* There must be a path separator, files in the current directory
* can't be executed. */
- if (gettail(name) != name && executable_file(name))
+ if ((use_path || gettail(name) != name) && executable_file(name))
{
if (path != NULL)
{