summaryrefslogtreecommitdiff
path: root/src/testdir/test_options.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-02-25 21:37:57 +0100
committerBram Moolenaar <Bram@vim.org>2017-02-25 21:37:57 +0100
commita12e40351d1357687e8b5dc3122fffef705bdc08 (patch)
treeb4d27ae401a3a6e7458eb95f9a6574959c679503 /src/testdir/test_options.vim
parentc43a8b8de0676caf8a460b6af1310d7aba8221bb (diff)
downloadvim-git-a12e40351d1357687e8b5dc3122fffef705bdc08.tar.gz
patch 8.0.0370: invalid memory access when setting wildchar emptyv8.0.0370
Problem: Invalid memory access when setting wildchar empty. Solution: Avoid going over the end of the option value. (Dominique Pelle, closes #1509) Make option test check all number options with empty value.
Diffstat (limited to 'src/testdir/test_options.vim')
-rw-r--r--src/testdir/test_options.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index 623e46c6f..ac43c1a81 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -29,6 +29,19 @@ function! Test_isfname()
set isfname&
endfunction
+function Test_wildchar()
+ " Empty 'wildchar' used to access invalid memory.
+ call assert_fails('set wildchar=', 'E521:')
+ call assert_fails('set wildchar=abc', 'E521:')
+ set wildchar=<Esc>
+ let a=execute('set wildchar?')
+ call assert_equal("\n wildchar=<Esc>", a)
+ set wildchar=27
+ let a=execute('set wildchar?')
+ call assert_equal("\n wildchar=<Esc>", a)
+ set wildchar&
+endfunction
+
function Test_options()
let caught = 'ok'
try