aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/core/util.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/luarocks/core/util.lua b/src/luarocks/core/util.lua
index bd50ca0b..dae8cfab 100644
--- a/src/luarocks/core/util.lua
+++ b/src/luarocks/core/util.lua
@@ -12,7 +12,10 @@ local require = nil
12-- May be used to read more, passing, for instance, "*a". 12-- May be used to read more, passing, for instance, "*a".
13-- @return string: the output of the program. 13-- @return string: the output of the program.
14function util.popen_read(cmd, spec) 14function util.popen_read(cmd, spec)
15 local tmpfile = os.tmpname() 15 local dir_sep = package.config:sub(1, 1)
16 local tmpfile = (dir_sep == "\\")
17 and (os.getenv("TMP") .. "/luarocks-" .. tostring(math.floor(math.random() * 10000)))
18 or os.tmpname()
16 os.execute(cmd .. " > " .. tmpfile) 19 os.execute(cmd .. " > " .. tmpfile)
17 local fd = io.open(tmpfile, "rb") 20 local fd = io.open(tmpfile, "rb")
18 if not fd then 21 if not fd then