aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2020-09-25 14:53:03 -0300
committerHisham Muhammad <hisham@gobolinux.org>2020-09-25 14:53:03 -0300
commit4a4951acd2169e97949d35b55dac47eaf776cda5 (patch)
treeee8efaca550a24ad6f859a4aa34c90bc549d429c
parent5615157fb7803081e8d14e025cff3f63486eaf13 (diff)
downloadluarocks-4a4951acd2169e97949d35b55dac47eaf776cda5.tar.gz
luarocks-4a4951acd2169e97949d35b55dac47eaf776cda5.tar.bz2
luarocks-4a4951acd2169e97949d35b55dac47eaf776cda5.zip
win32: generate proper temp filename
Closes #1224. See https://github.com/luarocks/luarocks/pull/1224/files#r493011698 Co-authored-by: dwenegar <simone.livieri@gmail.com>
-rw-r--r--src/luarocks/fs/win32.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua
index f544393d..8ae62cf0 100644
--- a/src/luarocks/fs/win32.lua
+++ b/src/luarocks/fs/win32.lua
@@ -336,7 +336,12 @@ function win32.make_temp_dir(name_pattern)
336end 336end
337 337
338function win32.tmpname() 338function win32.tmpname()
339 return os.getenv("TMP")..os.tmpname() 339 local name = os.tmpname()
340 local tmp = os.getenv("TMP")
341 if tmp and name:sub(1, #tmp) ~= tmp then
342 name = (tmp .. "\\" .. name):gsub("\\+", "\\")
343 end
344 return name
340end 345end
341 346
342function win32.current_user() 347function win32.current_user()