diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/os_win32.c | 6 | ||||
-rw-r--r-- | src/testdir/test_functions.vim | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 25 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); } } diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index a1b9b3d26..87b3844f2 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -2906,4 +2906,22 @@ func Test_isabsolutepath() endif endfunc +" Test for exepath() +func Test_exepath() + if has('win32') + call assert_notequal(exepath('cmd'), '') + + let oldNoDefaultCurrentDirectoryInExePath = $NoDefaultCurrentDirectoryInExePath + call writefile(['@echo off', 'echo Evil'], 'vim-test-evil.bat') + let $NoDefaultCurrentDirectoryInExePath = '' + call assert_notequal(exepath("vim-test-evil.bat"), '') + let $NoDefaultCurrentDirectoryInExePath = '1' + call assert_equal(exepath("vim-test-evil.bat"), '') + let $NoDefaultCurrentDirectoryInExePath = oldNoDefaultCurrentDirectoryInExePath + call delete('vim-test-evil.bat') + else + call assert_notequal(exepath('sh'), '') + endif +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 5cbdf3f61..c3ecb6255 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4860, +/**/ 4859, /**/ 4858, |