mirror of
https://github.com/neovim/neovim.git
synced 2025-11-15 06:49:01 +00:00
fix(trust): :trust command on Windows #36509
`:trust` command calculated SHA-256 on file content reading it as a text. While it doesn't matter on Unices, on Windows hash was calculated incorectly. SHA-256 for buffer content was calculated fine though. After this fix hashes in `%LOCALAPPDATA%/nvim-data/trust` are the same as in output of `sha256sum -t`.
This commit is contained in:
committed by
GitHub
parent
653871da1b
commit
b15b22fc73
@@ -47,7 +47,7 @@ local function compute_hash(fullpath, bufnr)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
do
|
do
|
||||||
local f = io.open(fullpath, 'r')
|
local f = io.open(fullpath, 'rb')
|
||||||
if not f then
|
if not f then
|
||||||
return nil, nil
|
return nil, nil
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user