summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2022-05-03 11:02:28 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-03 11:02:28 +0100
commit05cf63e9bdca1ac070df3e7d9c6dfc45e68ac916 (patch)
tree449168068b07a9bb8a6d12b935a0d67ad7506b0e /src/os_win32.c
parent3a974a89331182139e12386275f052a50c247ecb (diff)
downloadvim-git-05cf63e9bdca1ac070df3e7d9c6dfc45e68ac916.tar.gz
patch 8.2.4860: MS-Windows: always uses current directory for executablesv8.2.4860
Problem: MS-Windows: always uses current directory for executables. Solution: Check the NoDefaultCurrentDirectoryInExePath environment variable. (Yasuhiro Matsumoto, closes #10341)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c6
1 files changed, 5 insertions, 1 deletions
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);
}
}