From 336ab2682e08b95c51b8cbafcf9697b5a42026d1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 9 Aug 2024 06:57:17 +0800 Subject: vim-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 vim/vim#10341) https://github.com/vim/vim/commit/05cf63e9bdca1ac070df3e7d9c6dfc45e68ac916 Omit doc change: override in later doc update. Co-authored-by: Yasuhiro Matsumoto --- test/old/testdir/test_functions.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/old/testdir/test_functions.vim') diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim index 29bec72f2b..df4c6b1556 100644 --- a/test/old/testdir/test_functions.vim +++ b/test/old/testdir/test_functions.vim @@ -3578,6 +3578,24 @@ 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 + " Test for virtcol() func Test_virtcol() new -- cgit