Skip to content

Commit

Permalink
patch 9.1.0800: tests: no error check when setting global 'termwinsize'
Browse files Browse the repository at this point in the history
Problem:  tests: no error check when setting global 'termwinsize'
Solution: Also validate when using setglobal (Milly).

closes: #15918

Signed-off-by: Milly <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
  • Loading branch information
Milly authored and chrisbra committed Oct 22, 2024
1 parent 19be0eb commit 8be10aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/optionstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3904,17 +3904,16 @@ did_set_termwinkey(optset_T *args UNUSED)
* The 'termwinsize' option is changed.
*/
char *
did_set_termwinsize(optset_T *args UNUSED)
did_set_termwinsize(optset_T *args)
{
char_u **varp = (char_u **)args->os_varp;
char_u *p;

if (*curwin->w_p_tws == NUL)
if ((*varp)[0] == NUL)
return NULL;

p = skipdigits(curwin->w_p_tws);
if (p == curwin->w_p_tws
|| (*p != 'x' && *p != '*')
|| *skipdigits(p + 1) != NUL)
p = skipdigits(*varp);
if (p == *varp || (*p != 'x' && *p != '*') || *skipdigits(p + 1) != NUL)
return e_invalid_argument;

return NULL;
Expand Down
1 change: 0 additions & 1 deletion src/testdir/gen_opt_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ let skip_setglobal_reasons = #{
\ sidescrolloff: 'TODO: fix missing error handling for setglobal',
\ tabstop: 'TODO: fix missing error handling for setglobal',
\ termwinkey: 'TODO: fix missing error handling for setglobal',
\ termwinsize: 'TODO: fix missing error handling for setglobal',
\ textwidth: 'TODO: fix missing error handling for setglobal',
\}

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,8 @@ static char *(features[]) =

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

0 comments on commit 8be10aa

Please sign in to comment.