summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-11-26 17:45:53 +0100
committerBram Moolenaar <Bram@vim.org>2016-11-26 17:45:53 +0100
commitf422bcc7f9615fe91fa69b059cfe4785093d3d4a (patch)
treeb2c5e2bf094337c71b80a2a01e8a3649245c007d
parent8a8199e4a1814b10630a770165502abb1121cd1b (diff)
patch 8.0.0104v8.0.0104
Problem: Value of 'thesaurus' option not checked properly. Solution: Add P_NDNAME flag. (Daisuke Suzuki)
-rw-r--r--src/option.c2
-rw-r--r--src/testdir/test_options.vim28
-rw-r--r--src/version.c2
3 files changed, 21 insertions, 11 deletions
diff --git a/src/option.c b/src/option.c
index 5b6dbe358c..fae10b6a2e 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2660,7 +2660,7 @@ static struct vimoption options[] =
{"textwidth", "tw", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
(char_u *)&p_tw, PV_TW,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
- {"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
+ {"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME,
#ifdef FEAT_INS_EXPAND
(char_u *)&p_tsr, PV_TSR,
#else
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index 88be8f9c5f..6dfb1bbe60 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -107,17 +107,25 @@ func Test_keymap_valid()
call assert_fails(":set kmp=trunc\x00name", "trunc")
endfunc
-func Test_dictionary()
+func Check_dir_option(name)
" Check that it's possible to set the option.
- set dictionary=/usr/share/dict/words
- call assert_equal('/usr/share/dict/words', &dictionary)
- set dictionary=/usr/share/dict/words,/and/there
- call assert_equal('/usr/share/dict/words,/and/there', &dictionary)
- set dictionary=/usr/share/dict\ words
- call assert_equal('/usr/share/dict words', &dictionary)
+ exe 'set ' . a:name . '=/usr/share/dict/words'
+ call assert_equal('/usr/share/dict/words', eval('&' . a:name))
+ exe 'set ' . a:name . '=/usr/share/dict/words,/and/there'
+ call assert_equal('/usr/share/dict/words,/and/there', eval('&' . a:name))
+ exe 'set ' . a:name . '=/usr/share/dict\ words'
+ call assert_equal('/usr/share/dict words', eval('&' . a:name))
" Check rejecting weird characters.
- call assert_fails("set dictionary=/not&there", "E474:")
- call assert_fails("set dictionary=/not>there", "E474:")
- call assert_fails("set dictionary=/not.*there", "E474:")
+ call assert_fails("set " . a:name . "=/not&there", "E474:")
+ call assert_fails("set " . a:name . "=/not>there", "E474:")
+ call assert_fails("set " . a:name . "=/not.*there", "E474:")
+endfunc
+
+func Test_dictionary()
+ call Check_dir_option('dictionary')
+endfunc
+
+func Test_thesaurus()
+ call Check_dir_option('thesaurus')
endfunc
diff --git a/src/version.c b/src/version.c
index 4dcbcfb733..0e3554ddcb 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 104,
+/**/
103,
/**/
102,