Skip to content

Commit

Permalink
patch 8.0.0743: the 'termsize' option can be set to an invalid value
Browse files Browse the repository at this point in the history
Problem:    The 'termsize' option can be set to an invalid value.
Solution:   Check the 'termsize' option to be valid.
  • Loading branch information
brammool committed Jul 22, 2017
1 parent 8f84c3a commit 825680f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -7479,6 +7479,19 @@ did_set_string_option(
}
#endif

#ifdef FEAT_TERMINAL
/* 'termsize' */
else if (varp == &curwin->w_p_tms)
{
if (*curwin->w_p_tms != NUL)
{
p = skipdigits(curwin->w_p_tms);
if (p == curwin->w_p_tms || *p != 'x' || *skipdigits(p + 1) != NUL)
errmsg = e_invarg;
}
}
#endif

/* Options that are a list of flags. */
else
{
Expand Down
1 change: 1 addition & 0 deletions src/testdir/gen_opt_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ let test_values = {
\ 'switchbuf': [['', 'useopen', 'split,newtab'], ['xxx']],
\ 'tagcase': [['smart', 'match'], ['', 'xxx', 'smart,match']],
\ 'term': [[], []],
\ 'termsize': [['', '24x80', '0x80', '32x0', '0x0'], ['xxx', '80', '8ax9', '24x80b']],
\ 'toolbar': [['', 'icons', 'text'], ['xxx']],
\ 'toolbariconsize': [['', 'tiny', 'huge'], ['xxx']],
\ 'ttymouse': [['', 'xterm'], ['xxx']],
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
743,
/**/
742,
/**/
Expand Down

0 comments on commit 825680f

Please sign in to comment.