blob: 807140da7ca06b714f928c9351338b5fa4b6b234 [file] [log] [blame]
Christian Brabandt4f174f02023-11-04 11:16:23 +01001vim9script
2
3# Vim runtime support library
4#
5# Maintainer: The Vim Project <https://github.com/vim/vim>
6# Last Change: 2023 Oct 25
7
8export def IsSafeExecutable(filetype: string, executable: string): bool
9 var cwd = getcwd()
10 return get(g:, filetype .. '_exec', get(g:, 'plugin_exec', 0))
11 && (fnamemodify(exepath(executable), ':p:h') !=# cwd
12 || (split($PATH, has('win32') ? ';' : ':')->index(cwd) != -1
13 && cwd != '.'))
14enddef
15
16# Uncomment this line to check for compilation errors early
17# defcompile