From 18b202492205b43ca009d9aee616788de4051ee8 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 14 Oct 2013 11:15:46 -0300 Subject: No need to quote backslashes in single-quoted strings. As referenced by @siffiejoe in #154. --- src/luarocks/fs/lua.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua index 32aac6d6..0e81d877 100644 --- a/src/luarocks/fs/lua.lua +++ b/src/luarocks/fs/lua.lua @@ -39,7 +39,7 @@ function Q(arg) assert(type(arg) == "string") -- FIXME Unix-specific - return "'" .. arg:gsub("\\", "\\\\"):gsub("'", "'\\''") .. "'" + return "'" .. arg:gsub("'", "'\\''") .. "'" end --- Test is file/dir is writable. @@ -514,15 +514,28 @@ local function http_request(url, http, loop_control) proxy = "http://" .. proxy end + io.write("Downloading "..url.." ...\n") + local dots = 0 local res, status, headers, err = http.request { url = url, proxy = proxy, redirect = false, sink = ltn12.sink.table(result), + step = function(...) + io.write(".") + io.flush() + dots = dots + 1 + if dots == 70 then + io.write("\n") + dots = 0 + end + return ltn12.pump.step(...) + end, headers = { ["user-agent"] = cfg.user_agent.." via LuaSocket" }, } + io.write("\n") if not res then return nil, status elseif status == 301 or status == 302 then -- cgit v1.2.3-55-g6feb