aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/os/fs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index 27db675c52..8f2324c554 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -242,9 +242,13 @@ bool os_can_exe(const char_u *name, char_u **abspath, bool use_path)
FUNC_ATTR_NONNULL_ARG(1)
{
bool no_path = !use_path || path_is_absolute(name);
-#ifndef WIN32
+#ifdef WIN32
// If the filename is "qualified" (relative or absolute) do not check $PATH.
no_path |= (name[0] == '.'
+ && ((name[1] == '/' || name[1] == '\\')
+ || (name[1] == '.' && (name[2] == '/' || name[2] == '\\'))));
+#else
+ no_path |= (name[0] == '.'
&& (name[1] == '/' || (name[1] == '.' && name[2] == '/')));
#endif