Use correct separator on windows

Ref #673
This commit is contained in:
Zachary Yedidia
2017-06-18 09:56:36 -04:00
parent 7ec222895c
commit 5ec08d0a29
2 changed files with 6 additions and 2 deletions

View File

@@ -92,6 +92,10 @@ function split(str, sep)
end
function basename(file)
local name = string.gsub(file, "(.*/)(.*)", "%2")
local sep = "/"
if OS == "windows" then
sep = "\\"
end
local name = string.gsub(file, "(.*" .. sep .. ")(.*)", "%2")
return name
end