mirror of
https://github.com/neovim/neovim.git
synced 2026-05-26 06:48:27 +00:00
refactor(path): more slash normalization #39426
Problem: 1. `vim_getenv` is followed by `TO_SLASH` when getting path-related variables. 2. cmd exits when launched with forward slash. Solution: 1. try calling `TO_SLASH` in `vim_getenv`. 2. pass fullpath via `lpApplicationName`, only include `cmd.exe` in cmdline. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
@@ -35,7 +35,7 @@ describe('vim.fn.environ()', function()
|
||||
local env = vim.fn.environ()
|
||||
assert(vim.tbl_count(env) > 10, 'environ() should have some env vars!')
|
||||
for k, v in pairs(env) do
|
||||
if v ~= '' and vim.fn.getenv(k) ~= v then
|
||||
if v ~= '' and vim.fn.getenv(k) ~= v and vim.fn.getenv(k) ~= v:gsub('\\', '/') then
|
||||
error(('environ()[%q] = %q, but vim.fn.getenv(%q) = %q'):format(k, v, k, vim.fn.getenv(k)))
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user