fix: path separator on Windows

This commit is contained in:
sxyazi
2024-09-05 22:35:15 +08:00
parent 0573024ca2
commit 9a1129cf39

View File

@@ -1,3 +1,4 @@
local WIN = ya.target_family() == "windows"
local PATS = { local PATS = {
{ "[MT]", 6 }, -- Modified { "[MT]", 6 }, -- Modified
{ "[AC]", 5 }, -- Added { "[AC]", 5 }, -- Added
@@ -14,6 +15,7 @@ local function match(line)
local path local path
if signs:find(p[1]) then if signs:find(p[1]) then
path = line:sub(4, 4) == '"' and line:sub(5, -2) or line:sub(4) path = line:sub(4, 4) == '"' and line:sub(5, -2) or line:sub(4)
path = WIN and path:gsub("/", "\\") or path
end end
if not path then if not path then
elseif path:find("[/\\]$") then elseif path:find("[/\\]$") then