Skip to content

Commit f422bcc

Browse files
committed
patch 8.0.0104
Problem: Value of 'thesaurus' option not checked properly. Solution: Add P_NDNAME flag. (Daisuke Suzuki)
1 parent 8a8199e commit f422bcc

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

src/option.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2660,7 +2660,7 @@ static struct vimoption options[] =
26602660
{"textwidth", "tw", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
26612661
(char_u *)&p_tw, PV_TW,
26622662
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
2663-
{"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
2663+
{"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME,
26642664
#ifdef FEAT_INS_EXPAND
26652665
(char_u *)&p_tsr, PV_TSR,
26662666
#else

src/testdir/test_options.vim

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,25 @@ func Test_keymap_valid()
107107
call assert_fails(":set kmp=trunc\x00name", "trunc")
108108
endfunc
109109

110-
func Test_dictionary()
110+
func Check_dir_option(name)
111111
" Check that it's possible to set the option.
112-
set dictionary=/usr/share/dict/words
113-
call assert_equal('/usr/share/dict/words', &dictionary)
114-
set dictionary=/usr/share/dict/words,/and/there
115-
call assert_equal('/usr/share/dict/words,/and/there', &dictionary)
116-
set dictionary=/usr/share/dict\ words
117-
call assert_equal('/usr/share/dict words', &dictionary)
112+
exe 'set ' . a:name . '=/usr/share/dict/words'
113+
call assert_equal('/usr/share/dict/words', eval('&' . a:name))
114+
exe 'set ' . a:name . '=/usr/share/dict/words,/and/there'
115+
call assert_equal('/usr/share/dict/words,/and/there', eval('&' . a:name))
116+
exe 'set ' . a:name . '=/usr/share/dict\ words'
117+
call assert_equal('/usr/share/dict words', eval('&' . a:name))
118118

119119
" Check rejecting weird characters.
120-
call assert_fails("set dictionary=/not&there", "E474:")
121-
call assert_fails("set dictionary=/not>there", "E474:")
122-
call assert_fails("set dictionary=/not.*there", "E474:")
120+
call assert_fails("set " . a:name . "=/not&there", "E474:")
121+
call assert_fails("set " . a:name . "=/not>there", "E474:")
122+
call assert_fails("set " . a:name . "=/not.*there", "E474:")
123+
endfunc
124+
125+
func Test_dictionary()
126+
call Check_dir_option('dictionary')
127+
endfunc
128+
129+
func Test_thesaurus()
130+
call Check_dir_option('thesaurus')
123131
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
104,
767769
/**/
768770
103,
769771
/**/

0 commit comments

Comments
 (0)