Merge #10606 'vim-patch:8.1.0404'

This commit is contained in:
Justin M. Keyes 2019-07-27 01:33:58 +02:00 committed by GitHub
commit af01b347d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -74,7 +74,6 @@ func Test_argadd()
call assert_equal(1, len(argv())) call assert_equal(1, len(argv()))
call assert_equal('some file', get(argv(), 0, '')) call assert_equal('some file', get(argv(), 0, ''))
call delete('Xargadd')
%argd %argd
new new
arga arga
@ -452,3 +451,10 @@ func Test_arg_all_expand()
call assert_equal('notexist Xx\ x runtest.vim', expand('##')) call assert_equal('notexist Xx\ x runtest.vim', expand('##'))
call delete('Xx x') call delete('Xx x')
endfunc endfunc
func Test_large_arg()
" Argument longer or equal to the number of columns used to cause
" access to invalid memory.
exe 'argadd ' .repeat('x', &columns)
args
endfunc

View File

@ -2063,7 +2063,7 @@ void list_in_columns(char_u **items, int size, int current)
if (Columns < width) { if (Columns < width) {
// Not enough screen columns - show one per line // Not enough screen columns - show one per line
for (i = 0; items[i] != NULL; i++) { for (i = 0; i < item_count; i++) {
version_msg_wrap(items[i], i == current); version_msg_wrap(items[i], i == current);
if (msg_col > 0) { if (msg_col > 0) {
msg_putchar('\n'); msg_putchar('\n');