Skip to content

Commit

Permalink
fix(sources.path): escape paths in vim.fn.system() call
Browse files Browse the repository at this point in the history
  • Loading branch information
Bekaboo committed Jan 20, 2025
1 parent 8267757 commit 3312fb1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/dropbar/sources/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ local function preview(sym)
if stat.size == 0 then
return preview_msg('Empty file')
end
if not vim.fn.system({ 'file', path }):match('text') then
if
not vim.fn.system({ 'file', vim.fn.shellescape(path) }):match('text')
then
return preview_msg('Binary file')
end

Expand Down

0 comments on commit 3312fb1

Please sign in to comment.