Skip to content

Commit

Permalink
Fix builtin lua function os.tempfolder (#7368)
Browse files Browse the repository at this point in the history
* Fix builtin lua function os.tempfolder
  • Loading branch information
nOOb3167 authored and nerzhul committed Jun 5, 2018
1 parent 35bc3e2 commit a2de439
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions builtin/mainmenu/common.lua
Expand Up @@ -172,14 +172,9 @@ os.tempfolder = function()
os.remove(filetocheck)

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

local backstring = filetocheck:reverse()
return filetocheck:sub(0, filetocheck:len() - backstring:find(DIR_DELIM) + 1) ..
randname
end

--------------------------------------------------------------------------------
Expand Down

0 comments on commit a2de439

Please sign in to comment.