diff options
| author | Barrett Ruth <br@barrettruth.com> | 2026-08-03 15:35:30 -0500 |
|---|---|---|
| committer | Barrett Ruth <br@barrettruth.com> | 2026-08-03 15:35:30 -0500 |
| commit | 755abbc8d5101b1ea79291635a91896fd752e8ef (patch) | |
| tree | 4394eba6f6416d44f48c7bd8c51b0cf1bd96a1aa /runtime/lua/nvim/zip.lua | |
| parent | 886a270e7f4162933e180d3d96c3ef7ea162d4a0 (diff) | |
| download | rneovim-755abbc8d5101b1ea79291635a91896fd752e8ef.tar.gz rneovim-755abbc8d5101b1ea79291635a91896fd752e8ef.tar.bz2 rneovim-755abbc8d5101b1ea79291635a91896fd752e8ef.zip | |
fix(zip): only refuse a cwd unzip on Windows
Diffstat (limited to 'runtime/lua/nvim/zip.lua')
| -rw-r--r-- | runtime/lua/nvim/zip.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/lua/nvim/zip.lua b/runtime/lua/nvim/zip.lua index 32eb97476c..50a96960c1 100644 --- a/runtime/lua/nvim/zip.lua +++ b/runtime/lua/nvim/zip.lua @@ -12,8 +12,12 @@ local function unzip() 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' + if vim.fn.has('win32') == 1 then + local dir = uv.fs_realpath(vim.fs.dirname(vim.fs.normalize(command))) + local cwd = uv.fs_realpath(vim.fn.getcwd()) + if dir and cwd and dir == cwd then + return nil, 'refusing to run unzip from the current directory' + end end return command end |