Permalink
Browse files

Fix builtin lua function os.tempfolder (#7368)

* Fix builtin lua function os.tempfolder
  • Loading branch information...
nOOb3167 authored and nerzhul committed Jun 5, 2018
1 parent 35bc3e2 commit a2de439a91df6876e13230696c05957a9da8b2ce
Showing with 3 additions and 8 deletions.
  1. +3 −8 builtin/mainmenu/common.lua
@@ -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

--------------------------------------------------------------------------------

0 comments on commit a2de439

Please sign in to comment.