Skip to content

Commit a6e4250

Browse files
committed
patch 7.4.1756
Problem: "dll" options are not expanded. Solution: Expand environment variables. (Ozaki Kiichi)
1 parent 517ffbe commit a6e4250

4 files changed

Lines changed: 42 additions & 6 deletions

File tree

src/option.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,7 @@ static struct vimoption options[] =
17661766
(char_u *)&p_lpl, PV_NONE,
17671767
{(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
17681768
#if defined(DYNAMIC_LUA)
1769-
{"luadll", NULL, P_STRING|P_VI_DEF|P_SECURE,
1769+
{"luadll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
17701770
(char_u *)&p_luadll, PV_NONE,
17711771
{(char_u *)DYNAMIC_LUA_DLL, (char_u *)0L}
17721772
SCRIPTID_INIT},
@@ -2012,7 +2012,7 @@ static struct vimoption options[] =
20122012
#endif
20132013
(char_u *)0L} SCRIPTID_INIT},
20142014
#if defined(DYNAMIC_PERL)
2015-
{"perldll", NULL, P_STRING|P_VI_DEF|P_SECURE,
2015+
{"perldll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
20162016
(char_u *)&p_perldll, PV_NONE,
20172017
{(char_u *)DYNAMIC_PERL_DLL, (char_u *)0L}
20182018
SCRIPTID_INIT},
@@ -2123,13 +2123,13 @@ static struct vimoption options[] =
21232123
#endif
21242124
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
21252125
#if defined(DYNAMIC_PYTHON3)
2126-
{"pythonthreedll", NULL, P_STRING|P_VI_DEF|P_SECURE,
2126+
{"pythonthreedll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
21272127
(char_u *)&p_py3dll, PV_NONE,
21282128
{(char_u *)DYNAMIC_PYTHON3_DLL, (char_u *)0L}
21292129
SCRIPTID_INIT},
21302130
#endif
21312131
#if defined(DYNAMIC_PYTHON)
2132-
{"pythondll", NULL, P_STRING|P_VI_DEF|P_SECURE,
2132+
{"pythondll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
21332133
(char_u *)&p_pydll, PV_NONE,
21342134
{(char_u *)DYNAMIC_PYTHON_DLL, (char_u *)0L}
21352135
SCRIPTID_INIT},
@@ -2208,7 +2208,7 @@ static struct vimoption options[] =
22082208
#endif
22092209
SCRIPTID_INIT},
22102210
#if defined(DYNAMIC_RUBY)
2211-
{"rubydll", NULL, P_STRING|P_VI_DEF|P_SECURE,
2211+
{"rubydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
22122212
(char_u *)&p_rubydll, PV_NONE,
22132213
{(char_u *)DYNAMIC_RUBY_DLL, (char_u *)0L}
22142214
SCRIPTID_INIT},
@@ -2592,7 +2592,7 @@ static struct vimoption options[] =
25922592
(char_u *)&p_tgst, PV_NONE,
25932593
{(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
25942594
#if defined(DYNAMIC_TCL)
2595-
{"tcldll", NULL, P_STRING|P_VI_DEF|P_SECURE,
2595+
{"tcldll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
25962596
(char_u *)&p_tcldll, PV_NONE,
25972597
{(char_u *)DYNAMIC_TCL_DLL, (char_u *)0L}
25982598
SCRIPTID_INIT},

src/testdir/test_alot.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ source test_delete.vim
88
source test_ex_undo.vim
99
source test_expr.vim
1010
source test_expand.vim
11+
source test_expand_dllpath.vim
1112
source test_feedkeys.vim
1213
source test_fnamemodify.vim
1314
source test_file_perm.vim
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
scriptencoding utf-8
2+
3+
func s:test_expand_dllpath(optname)
4+
let $TEST_EXPAND_DLLPATH = '/dllpath/lib' . substitute(a:optname, '\zedll$', '.', '')
5+
execute 'let dllpath_save = &' . a:optname
6+
try
7+
execute 'set ' . a:optname . '=$TEST_EXPAND_DLLPATH'
8+
execute 'call assert_equal("' . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')'
9+
10+
execute 'set ' . a:optname . '=~' . $TEST_EXPAND_DLLPATH
11+
execute 'call assert_equal("' . $HOME . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')'
12+
finally
13+
execute 'let &' . a:optname . ' = dllpath_save'
14+
let $TEST_EXPAND_DLLPATH = ''
15+
endtry
16+
endfunc
17+
18+
func s:generate_test_if_exists(optname)
19+
if exists('&' . a:optname)
20+
execute join([
21+
\ 'func Test_expand_' . a:optname . '()',
22+
\ ' call s:test_expand_dllpath("' . a:optname . '")',
23+
\ 'endfunc'
24+
\ ], "\n")
25+
endif
26+
endfunc
27+
28+
call s:generate_test_if_exists('luadll')
29+
call s:generate_test_if_exists('perldll')
30+
call s:generate_test_if_exists('pythondll')
31+
call s:generate_test_if_exists('pythonthreedll')
32+
call s:generate_test_if_exists('rubydll')
33+
call s:generate_test_if_exists('tcldll')

src/version.c

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

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1756,
751753
/**/
752754
1755,
753755
/**/

0 commit comments

Comments
 (0)