Skip to content

Commit a2de439

Browse files
nOOb3167nerzhul
authored andcommitted
Fix builtin lua function os.tempfolder (#7368)
* Fix builtin lua function os.tempfolder
1 parent 35bc3e2 commit a2de439

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

builtin/mainmenu/common.lua

+3-8
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,9 @@ os.tempfolder = function()
172172
os.remove(filetocheck)
173173

174174
local randname = "MTTempModFolder_" .. math.random(0,10000)
175-
if DIR_DELIM == "\\" then
176-
local tempfolder = os.getenv("TEMP")
177-
return tempfolder .. filetocheck
178-
else
179-
local backstring = filetocheck:reverse()
180-
return filetocheck:sub(0,filetocheck:len()-backstring:find(DIR_DELIM)+1) ..randname
181-
end
182-
175+
local backstring = filetocheck:reverse()
176+
return filetocheck:sub(0, filetocheck:len() - backstring:find(DIR_DELIM) + 1) ..
177+
randname
183178
end
184179

185180
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)