patch 8.1.2115: MS-Windows: shell commands fail if &shell contains a space
Problem: MS-Windows: shell commands fail if &shell contains a space.
Solution: Use quotes instead of escaping. (closes #4920)
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim
index ceee044..f10eabb 100644
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -574,11 +574,17 @@
quit!
[CODE]
- let $SHELL = '/bin/with space/sh'
+ if has('win32')
+ let $SHELL = 'C:\with space\cmd.exe'
+ let expected = '"C:\with space\cmd.exe"'
+ else
+ let $SHELL = '/bin/with space/sh'
+ let expected = '/bin/with\ space/sh'
+ endif
+
if RunVimPiped([], after, '', '')
let lines = readfile('Xtestout')
- " MS-Windows adds a space after the word
- call assert_equal('/bin/with\ space/sh', lines[0])
+ call assert_equal(expected, lines[0])
endif
call delete('Xtestout')
endfunc