aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/gzip.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/autoload/gzip.vim')
-rw-r--r--runtime/autoload/gzip.vim7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/autoload/gzip.vim b/runtime/autoload/gzip.vim
index 95dd906794..ac9e37bf85 100644
--- a/runtime/autoload/gzip.vim
+++ b/runtime/autoload/gzip.vim
@@ -10,12 +10,17 @@
fun s:check(cmd)
let name = substitute(a:cmd, '\(\S*\).*', '\1', '')
if !exists("s:have_" . name)
+ " safety check, don't execute anything from the current directory
+ let f = fnamemodify(exepath(name), ":p:h") !=# getcwd()
+ if !f
+ echoerr "Warning: NOT executing " .. name .. " from current directory!"
+ endif
let e = executable(name)
if e < 0
let r = system(name . " --version")
let e = (r !~ "not found" && r != "")
endif
- exe "let s:have_" . name . "=" . e
+ exe "let s:have_" . name . "=" . (e && f)
endif
exe "return s:have_" . name
endfun