aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/ruby.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ftplugin/ruby.vim')
-rw-r--r--runtime/ftplugin/ruby.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim
index a424801cd1..b61c1765d9 100644
--- a/runtime/ftplugin/ruby.vim
+++ b/runtime/ftplugin/ruby.vim
@@ -61,6 +61,10 @@ if !exists('g:ruby_version_paths')
endif
function! s:query_path(root) abort
+ " Disabled by default for security reasons.
+ if !get(g:, 'ruby_exec', get(g:, 'plugin_exec', 0))
+ return []
+ endif
let code = "print $:.join %q{,}"
if &shell =~# 'sh' && empty(&shellxquote)
let prefix = 'env PATH='.shellescape($PATH).' '
@@ -84,7 +88,7 @@ function! s:query_path(root) abort
else
let path = split(system(path_check),',')
endif
- unlet s:tmp_cwd
+ unlet! s:tmp_cwd
exe cd cwd
return path
finally