1
0
Fork 0

Fix builtin lua function os.tempfolder (#7368)

* Fix builtin lua function os.tempfolder
mutilcraft-mt53
nOOb3167 2018-06-05 23:08:10 +02:00 committed by Loïc Blot
parent 35bc3e2f17
commit a2de439a91
1 changed files with 3 additions and 8 deletions

View File

@ -172,14 +172,9 @@ os.tempfolder = function()
os.remove(filetocheck) os.remove(filetocheck)
local randname = "MTTempModFolder_" .. math.random(0,10000) local randname = "MTTempModFolder_" .. math.random(0,10000)
if DIR_DELIM == "\\" then local backstring = filetocheck:reverse()
local tempfolder = os.getenv("TEMP") return filetocheck:sub(0, filetocheck:len() - backstring:find(DIR_DELIM) + 1) ..
return tempfolder .. filetocheck randname
else
local backstring = filetocheck:reverse()
return filetocheck:sub(0,filetocheck:len()-backstring:find(DIR_DELIM)+1) ..randname
end
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------