while (*p != NUL && (inquote || (*p != ' ' && *p != TAB)))
{
if (p[0] == '"')
- /* quotes surrounding an argument and are dropped */
+ // quotes surrounding an argument and are dropped
inquote = !inquote;
else
{
- if (p[0] == '\\' && p[1] != NUL)
+ if (rem_backslash(p))
{
- /* First pass: skip over "\ " and "\"".
- * Second pass: Remove the backslash. */
+ // First pass: skip over "\ " and "\"".
+ // Second pass: Remove the backslash.
++p;
}
if (i == 1)
call WaitForAssert({-> assert_equal(1, g:linecount)})
endfunc
+func Test_job_start_windows()
+ if !has('job') || !has('win32')
+ return
+ endif
+
+ " Check that backslash in $COMSPEC is handled properly.
+ let g:echostr = ''
+ let cmd = $COMSPEC . ' /c echo 123'
+ let job = job_start(cmd, {'callback': {ch,msg -> execute(":let g:echostr .= msg")}})
+ let info = job_info(job)
+ call assert_equal([$COMSPEC, '/c', 'echo', '123'], info.cmd)
+
+ call WaitForAssert({-> assert_equal("123", g:echostr)})
+ unlet g:echostr
+endfunc
+
func Test_env()
if !has('job')
return