mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Fix builtin lua function os.tempfolder (#7368)
* Fix builtin lua function os.tempfolder
This commit is contained in:
@@ -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 tempfolder = os.getenv("TEMP")
|
|
||||||
return tempfolder .. filetocheck
|
|
||||||
else
|
|
||||||
local backstring = filetocheck:reverse()
|
local backstring = filetocheck:reverse()
|
||||||
return filetocheck:sub(0,filetocheck:len()-backstring:find(DIR_DELIM)+1) ..randname
|
return filetocheck:sub(0, filetocheck:len() - backstring:find(DIR_DELIM) + 1) ..
|
||||||
end
|
randname
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user