diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2013-10-14 11:15:46 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2013-10-14 11:15:46 -0300 |
| commit | 18b202492205b43ca009d9aee616788de4051ee8 (patch) | |
| tree | 734484a23a7dbb5ab64708e396b270392b65146d /src | |
| parent | a3c1394f7f1e0702e0d5cce89467eb0cb26388c9 (diff) | |
| download | luarocks-18b202492205b43ca009d9aee616788de4051ee8.tar.gz luarocks-18b202492205b43ca009d9aee616788de4051ee8.tar.bz2 luarocks-18b202492205b43ca009d9aee616788de4051ee8.zip | |
No need to quote backslashes in single-quoted strings.
As referenced by @siffiejoe in #154.
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/fs/lua.lua | 15 |
1 files changed, 14 insertions, 1 deletions
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) | |||
| 39 | assert(type(arg) == "string") | 39 | assert(type(arg) == "string") |
| 40 | 40 | ||
| 41 | -- FIXME Unix-specific | 41 | -- FIXME Unix-specific |
| 42 | return "'" .. arg:gsub("\\", "\\\\"):gsub("'", "'\\''") .. "'" | 42 | return "'" .. arg:gsub("'", "'\\''") .. "'" |
| 43 | end | 43 | end |
| 44 | 44 | ||
| 45 | --- Test is file/dir is writable. | 45 | --- Test is file/dir is writable. |
| @@ -514,15 +514,28 @@ local function http_request(url, http, loop_control) | |||
| 514 | proxy = "http://" .. proxy | 514 | proxy = "http://" .. proxy |
| 515 | end | 515 | end |
| 516 | 516 | ||
| 517 | io.write("Downloading "..url.." ...\n") | ||
| 518 | local dots = 0 | ||
| 517 | local res, status, headers, err = http.request { | 519 | local res, status, headers, err = http.request { |
| 518 | url = url, | 520 | url = url, |
| 519 | proxy = proxy, | 521 | proxy = proxy, |
| 520 | redirect = false, | 522 | redirect = false, |
| 521 | sink = ltn12.sink.table(result), | 523 | sink = ltn12.sink.table(result), |
| 524 | step = function(...) | ||
| 525 | io.write(".") | ||
| 526 | io.flush() | ||
| 527 | dots = dots + 1 | ||
| 528 | if dots == 70 then | ||
| 529 | io.write("\n") | ||
| 530 | dots = 0 | ||
| 531 | end | ||
| 532 | return ltn12.pump.step(...) | ||
| 533 | end, | ||
| 522 | headers = { | 534 | headers = { |
| 523 | ["user-agent"] = cfg.user_agent.." via LuaSocket" | 535 | ["user-agent"] = cfg.user_agent.." via LuaSocket" |
| 524 | }, | 536 | }, |
| 525 | } | 537 | } |
| 538 | io.write("\n") | ||
| 526 | if not res then | 539 | if not res then |
| 527 | return nil, status | 540 | return nil, status |
| 528 | elseif status == 301 or status == 302 then | 541 | elseif status == 301 or status == 302 then |
