summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1296
blob: f516b47a9933953bec526bd6bccddedffa54819a (plain)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1296
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.1296
Problem:    Crash when using invalid command line argument.
Solution:   Check for options not being initialized.
Files:	    src/term.c, src/testdir/test_startup.vim


*** ../vim-8.1.1295/src/term.c	2019-05-04 16:58:41.613537362 +0200
--- src/term.c	2019-05-08 16:36:20.371184451 +0200
***************
*** 3014,3026 ****
      void
  term_push_title(int which)
  {
!     if ((which & SAVE_RESTORE_TITLE) && *T_CST != NUL)
      {
  	OUT_STR(T_CST);
  	out_flush();
      }
  
!     if ((which & SAVE_RESTORE_ICON) && *T_SSI != NUL)
      {
  	OUT_STR(T_SSI);
  	out_flush();
--- 3014,3026 ----
      void
  term_push_title(int which)
  {
!     if ((which & SAVE_RESTORE_TITLE) && T_CST != NULL && *T_CST != NUL)
      {
  	OUT_STR(T_CST);
  	out_flush();
      }
  
!     if ((which & SAVE_RESTORE_ICON) && T_SSI != NULL && *T_SSI != NUL)
      {
  	OUT_STR(T_SSI);
  	out_flush();
***************
*** 3033,3045 ****
      void
  term_pop_title(int which)
  {
!     if ((which & SAVE_RESTORE_TITLE) && *T_CRT != NUL)
      {
  	OUT_STR(T_CRT);
  	out_flush();
      }
  
!     if ((which & SAVE_RESTORE_ICON) && *T_SRI != NUL)
      {
  	OUT_STR(T_SRI);
  	out_flush();
--- 3033,3045 ----
      void
  term_pop_title(int which)
  {
!     if ((which & SAVE_RESTORE_TITLE) && T_CRT != NULL && *T_CRT != NUL)
      {
  	OUT_STR(T_CRT);
  	out_flush();
      }
  
!     if ((which & SAVE_RESTORE_ICON) && T_SRI != NULL && *T_SRI != NUL)
      {
  	OUT_STR(T_SRI);
  	out_flush();
*** ../vim-8.1.1295/src/testdir/test_startup.vim	2019-05-07 22:10:47.082118240 +0200
--- src/testdir/test_startup.vim	2019-05-08 16:39:13.558191165 +0200
***************
*** 408,419 ****
    endfor
  
    if has('clientserver')
-     " FIXME: need to add --servername to this list
-     " but it causes vim-8.1.1282 to crash!
      for opt in ['--remote', '--remote-send', '--remote-silent', '--remote-expr',
            \     '--remote-tab', '--remote-tab-wait',
            \     '--remote-tab-wait-silent', '--remote-tab-silent',
            \     '--remote-wait', '--remote-wait-silent',
            \    ]
        let out = split(system(GetVimCommand() .. ' '  .. opt), "\n")
        call assert_equal(1, v:shell_error)
--- 408,418 ----
    endfor
  
    if has('clientserver')
      for opt in ['--remote', '--remote-send', '--remote-silent', '--remote-expr',
            \     '--remote-tab', '--remote-tab-wait',
            \     '--remote-tab-wait-silent', '--remote-tab-silent',
            \     '--remote-wait', '--remote-wait-silent',
+           \     '--servername',
            \    ]
        let out = split(system(GetVimCommand() .. ' '  .. opt), "\n")
        call assert_equal(1, v:shell_error)
***************
*** 423,436 ****
      endfor
    endif
  
!   " FIXME: commented out as this causes vim-8.1.1282 to crash!
!   "if has('clipboard')
!   "  let out = split(system(GetVimCommand() .. ' --display'), "\n")
!   "  call assert_equal(1, v:shell_error)
!   "  call assert_match('^VIM - Vi IMproved .* (.*)$',         out[0])
!   "  call assert_equal('Argument missing after: "--display"', out[1])
!   "  call assert_equal('More info with: "vim -h"',            out[2])
!   "endif
  
    let out = split(system(GetVimCommand() .. ' -ix'), "\n")
    call assert_equal(1, v:shell_error)
--- 422,434 ----
      endfor
    endif
  
!   if has('clipboard')
!     let out = split(system(GetVimCommand() .. ' --display'), "\n")
!     call assert_equal(1, v:shell_error)
!     call assert_match('^VIM - Vi IMproved .* (.*)$',         out[0])
!     call assert_equal('Argument missing after: "--display"', out[1])
!     call assert_equal('More info with: "vim -h"',            out[2])
!   endif
  
    let out = split(system(GetVimCommand() .. ' -ix'), "\n")
    call assert_equal(1, v:shell_error)
***************
*** 463,478 ****
      call assert_equal('More info with: "vim -h"',                                       out[2])
    endfor
  
!   " FIXME: commented out as this causes vim-8.1.1282 to crash!
!   "if has('gui_gtk')
!   "  for opt in ['--socketid x', '--socketid 0xg']
!   "    let out = split(system(GetVimCommand() .. ' ' .. opt), "\n")
!   "    call assert_equal(1, v:shell_error)
!   "    call assert_match('^VIM - Vi IMproved .* (.*)$',        out[0])
!   "    call assert_equal('Invalid argument for: "--socketid"', out[1])
!   "    call assert_equal('More info with: "vim -h"',           out[2])
!   "  endfor
!   "endif
  endfunc
  
  func Test_file_args()
--- 461,475 ----
      call assert_equal('More info with: "vim -h"',                                       out[2])
    endfor
  
!   if has('gui_gtk')
!     for opt in ['--socketid x', '--socketid 0xg']
!       let out = split(system(GetVimCommand() .. ' ' .. opt), "\n")
!       call assert_equal(1, v:shell_error)
!       call assert_match('^VIM - Vi IMproved .* (.*)$',        out[0])
!       call assert_equal('Invalid argument for: "--socketid"', out[1])
!       call assert_equal('More info with: "vim -h"',           out[2])
!     endfor
!   endif
  endfunc
  
  func Test_file_args()
*** ../vim-8.1.1295/src/version.c	2019-05-07 23:01:34.241209371 +0200
--- src/version.c	2019-05-08 16:37:45.622695748 +0200
***************
*** 769,770 ****
--- 769,772 ----
  {   /* Add new patch number below this line */
+ /**/
+     1296,
  /**/

-- 
"Software is like sex... it's better when it's free."
		-- Linus Torvalds, initiator of the free Linux OS
Makes me wonder what FSF stands for...?

 /// 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    ///