]> granicus.if.org Git - vim/commitdiff
patch 8.0.0743: the 'termsize' option can be set to an invalid value v8.0.0743
authorBram Moolenaar <Bram@vim.org>
Sat, 22 Jul 2017 15:04:02 +0000 (17:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 22 Jul 2017 15:04:02 +0000 (17:04 +0200)
Problem:    The 'termsize' option can be set to an invalid value.
Solution:   Check the 'termsize' option to be valid.

src/option.c
src/testdir/gen_opt_test.vim
src/version.c

index 8e91fae74ae8d1719f0bfd8f8ed928a9bcafe75d..524789371416d1b204219688bbd931d44804b3ae 100644 (file)
@@ -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
     {
index 019c757df961c27bcbb807558ed2060cbb13f960..128a918147dc7a304fc18357771750b08efd6b49 100644 (file)
@@ -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']],
index b678ed92b8f5ec58bd6207fb94d95104781ac274..da56b9a313f5a32a421c32d25240ddd81f0c93c9 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    743,
 /**/
     742,
 /**/