From 05cf63e9bdca1ac070df3e7d9c6dfc45e68ac916 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Tue, 3 May 2022 11:02:28 +0100 Subject: patch 8.2.4860: MS-Windows: always uses current directory for executables Problem: MS-Windows: always uses current directory for executables. Solution: Check the NoDefaultCurrentDirectoryInExePath environment variable. (Yasuhiro Matsumoto, closes #10341) --- src/os_win32.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/os_win32.c') diff --git a/src/os_win32.c b/src/os_win32.c index 53107d530..97595d6eb 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -2237,7 +2237,11 @@ executable_exists(char *name, char_u **path, int use_path, int use_pathext) retval = FALSE; goto theend; } - STRCPY(pathbuf, ".;"); + + if (mch_getenv("NoDefaultCurrentDirectoryInExePath") == NULL) + STRCPY(pathbuf, ".;"); + else + *pathbuf = NUL; STRCAT(pathbuf, p); } } -- cgit v1.2.1