mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
fix(vim.fs): dirname() returns "." on mingw/msys2 #30480
Problem:
`vim.fs.dirname([[C:\User\XXX\AppData\Local]])` returns "." on
mingw/msys2.
Solution:
- Check for "mingw" when deciding `iswin`.
- Use `has("win32")` where possible, it works in "fast" contexts since
b02eeb6a72.
This commit is contained in:
@@ -208,8 +208,7 @@ end
|
||||
---@return string|function
|
||||
---@private
|
||||
function Loader.loader_lib(modname)
|
||||
local sysname = uv.os_uname().sysname:lower() or ''
|
||||
local is_win = sysname:find('win', 1, true) and not sysname:find('darwin', 1, true)
|
||||
local is_win = vim.fn.has('win32') == 1
|
||||
local ret = M.find(modname, { patterns = is_win and { '.dll' } or { '.so' } })[1]
|
||||
if ret then
|
||||
-- Making function name in Lua 5.1 (see src/loadlib.c:mkfuncname) is
|
||||
|
||||
Reference in New Issue
Block a user