aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authornOOb3167 <nOOb3167@gmail.com>2018-06-05 23:08:10 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-06-05 23:08:10 +0200
commita2de439a91df6876e13230696c05957a9da8b2ce (patch)
tree2103382388bde724643b20b81615a89c227a8623 /builtin
parent35bc3e2f17a016f1ff5d2f27dc87e71b9e4bf023 (diff)
downloadminetest-a2de439a91df6876e13230696c05957a9da8b2ce.tar.gz
minetest-a2de439a91df6876e13230696c05957a9da8b2ce.tar.bz2
minetest-a2de439a91df6876e13230696c05957a9da8b2ce.zip
Fix builtin lua function os.tempfolder (#7368)
* Fix builtin lua function os.tempfolder
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mainmenu/common.lua11
1 files 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
--------------------------------------------------------------------------------