Problem: Illegal memory access when 'complete' ends in a backslash.
Solution: Check for trailing backslash. (Dominique Pelle, closes #1478)
/* skip optional filename after 'k' and 's' */
while (*s && *s != ',' && *s != ' ')
{
- if (*s == '\\')
+ if (*s == '\\' && s[1] != NUL)
++s;
++s;
}
call Check_dir_option('thesaurus')
endfun
+func Test_complete()
+ " Trailing single backslash used to cause invalid memory access.
+ set complete=s\
+ new
+ call feedkeys("i\<C-N>\<Esc>", 'xt')
+ bwipe!
+ set complete&
+endfun
+
func Test_set_completion()
call feedkeys(":set di\<C-A>\<C-B>\"\<CR>", 'tx')
call assert_equal('"set dictionary diff diffexpr diffopt digraph directory display', @:)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 333,
/**/
332,
/**/