]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0444: Cannot set 'path' option via modeline v9.2.0444
authorChristian Brabandt <cb@256bit.org>
Tue, 5 May 2026 19:47:19 +0000 (19:47 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 5 May 2026 19:47:19 +0000 (19:47 +0000)
Problem:  Cannot set 'path' option via modeline (zeertzjq, after v9.2.0435)
Solution: Revert the part that disallows setting 'path' via modeline.

closes: #20137

Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/options.txt
src/optiondefs.h
src/testdir/test_find_complete.vim
src/testdir/test_modeline.vim
src/version.c

index c4b2df144bbcfeb0496b6c711ea03cc3626cdcf6..2baf8a01a789770956737567b39d0c5d9c67340d 100644 (file)
@@ -6799,9 +6799,6 @@ A jump table for the options with a short description can be found at |Q_op|.
 <      Replace the ';' with a ':' or whatever separator is used.  Note that
        this doesn't work when $INCL contains a comma or white space.
 
-       This option cannot be set from a |modeline| or in the |sandbox|, for
-       security reasons.
-
                                                *'perldll'*
 'perldll'              string  (default depends on the build)
                        global
index f712ab7a14aec257e1b93667abb28b5f0db94f4d..0a93b70f8ef82be9c4dccfbc1d0e5b59c665ca0f 100644 (file)
@@ -1958,7 +1958,7 @@ static struct vimoption options[] =
                            (char_u *)&p_pm, PV_NONE,
                            did_set_backupext_or_patchmode, NULL,
                            {(char_u *)"", (char_u *)0L} SCTX_INIT},
-    {"path",       "pa",   P_STRING|P_EXPAND|P_VI_DEF|P_SECURE|P_COMMA|P_NODUP,
+    {"path",       "pa",   P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP,
                            (char_u *)&p_path, PV_PATH, NULL, NULL,
                            {
 #if defined(AMIGA) || defined(MSWIN)
index 8b8b71c30301294379527d5c3d05278a7e512dd2..db1860dc4013e7de3142409abb97a15a501a881d 100644 (file)
@@ -165,9 +165,15 @@ endfunc
 func Test_find_completion_backtick_in_path()
   CheckUnix
   CheckExecutable id
+  set nomodelinestrict modeline
 
+  let lines =<< trim END
+    // vim: set path+=`id>Xrce_marker` :
+  END
+
+  call writefile(lines, 'Xpoc.c', 'D')
   new Xpoc.c
-  setl path+=`id>Xrce_marker`
+  call assert_match('`id>Xrce_marker`', &path)
   " Triggering completion must not execute the backtick command.
   call getcompletion('', 'file_in_path')
   call assert_false(filereadable('Xrce_marker'))
@@ -176,6 +182,7 @@ func Test_find_completion_backtick_in_path()
 
   bwipe!
   call delete('Xrce_marker')
+  set modelinestrict& modeline&
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
index 6cbf87638a86173c3887e513c941a27d2e6bbae0..6884ab473d7d2d5c5666905606c798ec080a41d8 100644 (file)
@@ -665,18 +665,4 @@ func Test_modeline_strict_cannot_be_set_from_modeline()
   let &modeline = modeline
 endfunc
 
-" Verify that backticks in 'path' set from a modeline are not executed
-func Test_path_modeline()
-  let lines =<< trim END
-    // vim: set path+=foobar :
-  END
-  call writefile(lines, 'Xpoc.c', 'D')
-
-  set nomodelinestrict modeline
-  call assert_fails('split Xpoc.c', 'E520:')
-
-  bwipe!
-  set modelinestrict& modeline&
-endfunc
-
 " vim: shiftwidth=2 sts=2 expandtab
index 61342e15f091a45e7c649f90e89d06aeb751c1f9..a859c2ceda3bee578425fa71b4b19b6ad04c6da9 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    444,
 /**/
     443,
 /**/