mirror of
https://github.com/neovim/neovim.git
synced 2026-08-26 00:51:53 +00:00
fix(zip): do not run unzip from the current directory
Problem: Windows searches the current directory before $PATH, so opening an archive in a directory that also contains an `unzip` executable runs that one. The legacy plugin refused this; the port dropped the check. Solution: Refuse to run `unzip` when it resolves to the current directory.
This commit is contained in:
@@ -10,6 +10,11 @@ local function unzip()
|
||||
if command == '' then
|
||||
return nil, 'unzip executable not found'
|
||||
end
|
||||
-- Windows searches the current directory before $PATH, so an archive could be opened with an
|
||||
-- `unzip` shipped next to it.
|
||||
if vim.fs.dirname(vim.fs.normalize(command)) == vim.fs.normalize(vim.fn.getcwd()) then
|
||||
return nil, 'refusing to run unzip from the current directory'
|
||||
end
|
||||
return command
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user