mirror of
https://github.com/neovim/neovim.git
synced 2025-11-30 14:10:50 +00:00
vim-patch:67c951df4c95
runtime(ftplugin): allow to exec if curdir is in PATH
In case the current directory is present as valid $PATH entry, it is OK
to call the program from it, even if vim curdir is in that same
directory.
(Without that patch, for instance, you will not be able to open .zip
files while your current directory is /bin)
closes: vim/vim#13027
67c951df4c
Co-authored-by: Anton Sharonov <anton.sharonov@gmail.com>
This commit is contained in:
@@ -55,7 +55,9 @@ endif
|
||||
" Set this once, globally.
|
||||
if !exists("perlpath")
|
||||
" safety check: don't execute perl from current directory
|
||||
if executable("perl") && fnamemodify(exepath("perl"), ":p:h") != getcwd()
|
||||
let s:tmp_cwd = getcwd()
|
||||
if executable("perl") && (fnamemodify(exepath("perl"), ":p:h") != s:tmp_cwd
|
||||
\ || (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) != -1 && s:tmp_cwd != '.'))
|
||||
try
|
||||
if &shellxquote != '"'
|
||||
let perlpath = system('perl -e "print join(q/,/,@INC)"')
|
||||
@@ -71,6 +73,7 @@ if !exists("perlpath")
|
||||
" current directory and the directory of the current file.
|
||||
let perlpath = ".,,"
|
||||
endif
|
||||
unlet s:tmp_cwd
|
||||
endif
|
||||
|
||||
" Append perlpath to the existing path value, if it is set. Since we don't
|
||||
|
||||
Reference in New Issue
Block a user