]> granicus.if.org Git - vim/commitdiff
patch 8.1.1367: can set 'modelineexpr' in modeline v8.1.1367
authorBram Moolenaar <Bram@vim.org>
Thu, 23 May 2019 15:08:49 +0000 (17:08 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 23 May 2019 15:08:49 +0000 (17:08 +0200)
Problem:    can set 'modelineexpr' in modeline.
Solution:   Add P_SECURE flag.

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

index 8e62efc9955c40c4670a052cb95e1ae2ed258697..39ef052eeae5ec5e102ba6c328b98cc311a2a143 100644 (file)
@@ -1889,7 +1889,7 @@ static struct vimoption options[] =
     {"modeline",    "ml",   P_BOOL|P_VIM,
                            (char_u *)&p_ml, PV_ML,
                            {(char_u *)FALSE, (char_u *)TRUE} SCTX_INIT},
-    {"modelineexpr", "mle",  P_BOOL|P_VI_DEF,
+    {"modelineexpr", "mle",  P_BOOL|P_VI_DEF|P_SECURE,
                            (char_u *)&p_mle, PV_NONE,
                            {(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
     {"modelines",   "mls",  P_NUM|P_VI_DEF,
index c33a0801c0d32eabdeb9a6d57b4d30e5b9058635..c3c624d266db60c52a062ffd0a348bd5159122fa 100644 (file)
@@ -119,6 +119,7 @@ func Test_modeline_fails_always()
   call s:modeline_fails('makespellmem', 'makespellmem=Something()', 'E520:')
   call s:modeline_fails('mzschemedll', 'mzschemedll=Something()', 'E520:')
   call s:modeline_fails('mzschemegcdll', 'mzschemegcdll=Something()', 'E520:')
+  call s:modeline_fails('modelineexpr', 'modelineexpr', 'E520:')
   call s:modeline_fails('omnifunc', 'omnifunc=Something()', 'E520:')
   call s:modeline_fails('operatorfunc', 'operatorfunc=Something()', 'E520:')
   call s:modeline_fails('perldll', 'perldll=Something()', 'E520:')
index bcc9aeff25ecd15089c5d9525ce1e6d9e8e7a881..7c548bdbadbc17716fda359b99176dc540b3fa95 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1367,
 /**/
     1366,
 /**/