diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2020-09-25 14:53:03 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2020-09-25 14:53:03 -0300 |
commit | 4a4951acd2169e97949d35b55dac47eaf776cda5 (patch) | |
tree | ee8efaca550a24ad6f859a4aa34c90bc549d429c /src | |
parent | 5615157fb7803081e8d14e025cff3f63486eaf13 (diff) | |
download | luarocks-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>
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fs/win32.lua | 7 |
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) | |||
336 | end | 336 | end |
337 | 337 | ||
338 | function win32.tmpname() | 338 | function 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 | ||
340 | end | 345 | end |
341 | 346 | ||
342 | function win32.current_user() | 347 | function win32.current_user() |