1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0464
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.1.0464
Problem: MS-Windows: job_info() has cmd without backslashes. (Daniel
Hahler)
Solution: Use rem_backslash(). (closes #3517, closes #3404)
Files: src/misc2.c, src/testdir/test_channel.vim
*** ../vim-8.1.0463/src/misc2.c 2018-09-30 21:43:17.195693290 +0200
--- src/misc2.c 2018-10-07 21:31:14.560595004 +0200
***************
*** 6458,6471 ****
while (*p != NUL && (inquote || (*p != ' ' && *p != TAB)))
{
if (p[0] == '"')
! /* quotes surrounding an argument and are dropped */
inquote = !inquote;
else
{
! if (p[0] == '\\' && p[1] != NUL)
{
! /* First pass: skip over "\ " and "\"".
! * Second pass: Remove the backslash. */
++p;
}
if (i == 1)
--- 6458,6471 ----
while (*p != NUL && (inquote || (*p != ' ' && *p != TAB)))
{
if (p[0] == '"')
! // quotes surrounding an argument and are dropped
inquote = !inquote;
else
{
! if (rem_backslash(p))
{
! // First pass: skip over "\ " and "\"".
! // Second pass: Remove the backslash.
++p;
}
if (i == 1)
*** ../vim-8.1.0463/src/testdir/test_channel.vim 2018-09-06 16:27:20.664831945 +0200
--- src/testdir/test_channel.vim 2018-10-07 21:34:54.394554136 +0200
***************
*** 1721,1726 ****
--- 1721,1742 ----
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
*** ../vim-8.1.0463/src/version.c 2018-10-07 20:48:33.941433087 +0200
--- src/version.c 2018-10-07 21:35:44.446090534 +0200
***************
*** 794,795 ****
--- 794,797 ----
{ /* Add new patch number below this line */
+ /**/
+ 464,
/**/
--
hundred-and-one symptoms of being an internet addict:
172. You join listservers just for the extra e-mail.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|