[vim] 72/139: patch 7.4.1756 Problem: "dll" options are not expanded. Solution: Expand environment variables. (Ozaki Kiichi)

James McCoy jamessan at debian.org
Fri May 6 04:00:05 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch debian/sid
in repository vim.

commit a6e42501424f6670fa864c739d2dc2eb764900b9
Author: Bram Moolenaar <Bram at vim.org>
Date:   Wed Apr 20 16:19:52 2016 +0200

    patch 7.4.1756
    Problem:    "dll" options are not expanded.
    Solution:   Expand environment variables. (Ozaki Kiichi)
---
 src/option.c                        | 12 ++++++------
 src/testdir/test_alot.vim           |  1 +
 src/testdir/test_expand_dllpath.vim | 33 +++++++++++++++++++++++++++++++++
 src/version.c                       |  2 ++
 4 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/src/option.c b/src/option.c
index 348c37a..a5b403c 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1766,7 +1766,7 @@ static struct vimoption options[] =
 			    (char_u *)&p_lpl, PV_NONE,
 			    {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
 #if defined(DYNAMIC_LUA)
-    {"luadll",      NULL,   P_STRING|P_VI_DEF|P_SECURE,
+    {"luadll",      NULL,   P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
 			    (char_u *)&p_luadll, PV_NONE,
 			    {(char_u *)DYNAMIC_LUA_DLL, (char_u *)0L}
 			    SCRIPTID_INIT},
@@ -2012,7 +2012,7 @@ static struct vimoption options[] =
 #endif
 				(char_u *)0L} SCRIPTID_INIT},
 #if defined(DYNAMIC_PERL)
-    {"perldll",     NULL,   P_STRING|P_VI_DEF|P_SECURE,
+    {"perldll",     NULL,   P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
 			    (char_u *)&p_perldll, PV_NONE,
 			    {(char_u *)DYNAMIC_PERL_DLL, (char_u *)0L}
 			    SCRIPTID_INIT},
@@ -2123,13 +2123,13 @@ static struct vimoption options[] =
 #endif
 			    {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
 #if defined(DYNAMIC_PYTHON3)
-    {"pythonthreedll",  NULL,   P_STRING|P_VI_DEF|P_SECURE,
+    {"pythonthreedll",  NULL,   P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
 			    (char_u *)&p_py3dll, PV_NONE,
 			    {(char_u *)DYNAMIC_PYTHON3_DLL, (char_u *)0L}
 			    SCRIPTID_INIT},
 #endif
 #if defined(DYNAMIC_PYTHON)
-    {"pythondll",   NULL,   P_STRING|P_VI_DEF|P_SECURE,
+    {"pythondll",   NULL,   P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
 			    (char_u *)&p_pydll, PV_NONE,
 			    {(char_u *)DYNAMIC_PYTHON_DLL, (char_u *)0L}
 			    SCRIPTID_INIT},
@@ -2208,7 +2208,7 @@ static struct vimoption options[] =
 #endif
 			    SCRIPTID_INIT},
 #if defined(DYNAMIC_RUBY)
-    {"rubydll",     NULL,   P_STRING|P_VI_DEF|P_SECURE,
+    {"rubydll",     NULL,   P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
 			    (char_u *)&p_rubydll, PV_NONE,
 			    {(char_u *)DYNAMIC_RUBY_DLL, (char_u *)0L}
 			    SCRIPTID_INIT},
@@ -2592,7 +2592,7 @@ static struct vimoption options[] =
 			    (char_u *)&p_tgst, PV_NONE,
 			    {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
 #if defined(DYNAMIC_TCL)
-    {"tcldll",      NULL,   P_STRING|P_VI_DEF|P_SECURE,
+    {"tcldll",      NULL,   P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
 			    (char_u *)&p_tcldll, PV_NONE,
 			    {(char_u *)DYNAMIC_TCL_DLL, (char_u *)0L}
 			    SCRIPTID_INIT},
diff --git a/src/testdir/test_alot.vim b/src/testdir/test_alot.vim
index cb37771..6bfd81e 100644
--- a/src/testdir/test_alot.vim
+++ b/src/testdir/test_alot.vim
@@ -8,6 +8,7 @@ source test_delete.vim
 source test_ex_undo.vim
 source test_expr.vim
 source test_expand.vim
+source test_expand_dllpath.vim
 source test_feedkeys.vim
 source test_fnamemodify.vim
 source test_file_perm.vim
diff --git a/src/testdir/test_expand_dllpath.vim b/src/testdir/test_expand_dllpath.vim
new file mode 100644
index 0000000..e69e7e1
--- /dev/null
+++ b/src/testdir/test_expand_dllpath.vim
@@ -0,0 +1,33 @@
+scriptencoding utf-8
+
+func s:test_expand_dllpath(optname)
+  let $TEST_EXPAND_DLLPATH = '/dllpath/lib' . substitute(a:optname, '\zedll$', '.', '')
+  execute 'let dllpath_save = &' . a:optname
+  try
+    execute 'set ' . a:optname . '=$TEST_EXPAND_DLLPATH' 
+    execute 'call assert_equal("' . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')' 
+
+    execute 'set ' . a:optname . '=~' . $TEST_EXPAND_DLLPATH
+    execute 'call assert_equal("' . $HOME . $TEST_EXPAND_DLLPATH . '", &' . a:optname . ')' 
+  finally
+    execute 'let &' . a:optname . ' = dllpath_save'
+    let $TEST_EXPAND_DLLPATH = ''
+  endtry
+endfunc
+
+func s:generate_test_if_exists(optname)
+  if exists('&' . a:optname)
+    execute join([
+          \ 'func Test_expand_' . a:optname . '()',
+          \ '  call s:test_expand_dllpath("' . a:optname . '")',
+          \ 'endfunc'
+          \ ], "\n")
+  endif
+endfunc
+
+call s:generate_test_if_exists('luadll')
+call s:generate_test_if_exists('perldll')
+call s:generate_test_if_exists('pythondll')
+call s:generate_test_if_exists('pythonthreedll')
+call s:generate_test_if_exists('rubydll')
+call s:generate_test_if_exists('tcldll')
diff --git a/src/version.c b/src/version.c
index 393b75d..6fdc9da 100644
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1756,
+/**/
     1755,
 /**/
     1754,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/vim.git



More information about the pkg-vim-maintainers mailing list