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)
diff --git a/src/os_win32.c b/src/os_win32.c
index 53107d5..97595d6 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2237,7 +2237,11 @@
retval = FALSE;
goto theend;
}
- STRCPY(pathbuf, ".;");
+
+ if (mch_getenv("NoDefaultCurrentDirectoryInExePath") == NULL)
+ STRCPY(pathbuf, ".;");
+ else
+ *pathbuf = NUL;
STRCAT(pathbuf, p);
}
}