]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0800: tests: no error check when setting global 'termwinsize' v9.1.0800
authorMilly <milly.ca@gmail.com>
Tue, 22 Oct 2024 20:01:46 +0000 (22:01 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 22 Oct 2024 20:01:46 +0000 (22:01 +0200)
Problem:  tests: no error check when setting global 'termwinsize'
Solution: Also validate when using setglobal (Milly).

closes: #15918

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/optionstr.c
src/testdir/gen_opt_test.vim
src/version.c

index b1bb39a62c5482c56d5fe538d8f6a66a5d8b8fe7..ccba9765f6fdd269116fe199532ad3bd41c3bee7 100644 (file)
@@ -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;
index e8556025258a51ea8efa8f5c75043c464bf0b429..7b0064cfd961b3199daea944543d984a0c310ca9 100644 (file)
@@ -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',
       \}
 
index 7a0b0ad1db52520bcad3a8e086b478c03bfcf58e..404ebf5e8287d29e5437b91d8b8f1721dc618728 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    800,
 /**/
     799,
 /**/