From a2de439a91df6876e13230696c05957a9da8b2ce Mon Sep 17 00:00:00 2001 From: nOOb3167 Date: Tue, 5 Jun 2018 23:08:10 +0200 Subject: [PATCH] Fix builtin lua function os.tempfolder (#7368) * Fix builtin lua function os.tempfolder --- builtin/mainmenu/common.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index 7c0cbae4d..cd4903f56 100644 --- a/builtin/mainmenu/common.lua +++ b/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 -------------------------------------------------------------------------------- -- 2.25.1