summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/secure.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2026-04-24 07:37:21 -0400
committerGitHub <noreply@github.com>2026-04-24 07:37:21 -0400
commit5c88492a13f80d23e7b0d48d036ed60a7d24be0d (patch)
tree4a0b030e0641297042dc03f533413bd01ee977a8 /runtime/lua/vim/secure.lua
parentc0e358f7e8ac92dbaba771a74d17d1754e3c6320 (diff)
fix(trust): always use "/" slashes in filepaths #39355
Problem: We should not use "\" (backslashes) except where absolutely required. See references in https://github.com/neovim/neovim/pull/37729 Solution: There is no reason to use "\" slashes in the trust db, so don't.
Diffstat (limited to 'runtime/lua/vim/secure.lua')
-rw-r--r--runtime/lua/vim/secure.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/lua/vim/secure.lua b/runtime/lua/vim/secure.lua
index 4a89139679..63cf4a8776 100644
--- a/runtime/lua/vim/secure.lua
+++ b/runtime/lua/vim/secure.lua
@@ -110,6 +110,7 @@ function M.read(path)
if not fullpath then
return nil
end
+ fullpath = vim.fs.normalize(fullpath) -- Ensure "/" slashes, even on Windows.
local trust = read_trust()
@@ -218,6 +219,7 @@ function M.trust(opts)
if not fullpath then
return false, string.format('invalid path: %s', path)
end
+ fullpath = vim.fs.normalize(fullpath) -- Ensure "/" slashes, even on Windows.
local trust = read_trust()