aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2017-03-14 20:36:41 +0300
committerHisham Muhammad <hisham@gobolinux.org>2017-04-14 19:08:53 -0300
commit21a37f56fa39eeb57493a4971863fa86466b55e2 (patch)
tree758b818f08a244e21536ecdf1798f771d1d5ff2f /src
parent63de2e0a9c1fe2fd05455b377414a28d7dc5d71e (diff)
downloadluarocks-21a37f56fa39eeb57493a4971863fa86466b55e2.tar.gz
luarocks-21a37f56fa39eeb57493a4971863fa86466b55e2.tar.bz2
luarocks-21a37f56fa39eeb57493a4971863fa86466b55e2.zip
Get rid of an implicit number to string conversion
Clearly tostring was implied instead of tonumber.
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/fs/tools.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/fs/tools.lua b/src/luarocks/fs/tools.lua
index d2062ed8..16dc9cf2 100644
--- a/src/luarocks/fs/tools.lua
+++ b/src/luarocks/fs/tools.lua
@@ -104,7 +104,7 @@ function tools.use_downloader(url, filename, cache)
104 if cfg.downloader == "wget" then 104 if cfg.downloader == "wget" then
105 local wget_cmd = fs.Q(vars.WGET).." "..vars.WGETNOCERTFLAG.." --no-cache --user-agent=\""..cfg.user_agent.." via wget\" --quiet " 105 local wget_cmd = fs.Q(vars.WGET).." "..vars.WGETNOCERTFLAG.." --no-cache --user-agent=\""..cfg.user_agent.." via wget\" --quiet "
106 if cfg.connection_timeout and cfg.connection_timeout > 0 then 106 if cfg.connection_timeout and cfg.connection_timeout > 0 then
107 wget_cmd = wget_cmd .. "--timeout="..tonumber(cfg.connection_timeout).." --tries=1 " 107 wget_cmd = wget_cmd .. "--timeout="..tostring(cfg.connection_timeout).." --tries=1 "
108 end 108 end
109 if cache then 109 if cache then
110 -- --timestamping is incompatible with --output-document, 110 -- --timestamping is incompatible with --output-document,
@@ -120,7 +120,7 @@ function tools.use_downloader(url, filename, cache)
120 elseif cfg.downloader == "curl" then 120 elseif cfg.downloader == "curl" then
121 local curl_cmd = fs.Q(vars.CURL).." "..vars.CURLNOCERTFLAG.." -f -L --user-agent \""..cfg.user_agent.." via curl\" " 121 local curl_cmd = fs.Q(vars.CURL).." "..vars.CURLNOCERTFLAG.." -f -L --user-agent \""..cfg.user_agent.." via curl\" "
122 if cfg.connection_timeout and cfg.connection_timeout > 0 then 122 if cfg.connection_timeout and cfg.connection_timeout > 0 then
123 curl_cmd = curl_cmd .. "--connect-timeout "..tonumber(cfg.connection_timeout).." " 123 curl_cmd = curl_cmd .. "--connect-timeout "..tostring(cfg.connection_timeout).." "
124 end 124 end
125 ok = fs.execute_string(fs.quiet_stderr(curl_cmd..fs.Q(url).." > "..fs.Q(filename))) 125 ok = fs.execute_string(fs.quiet_stderr(curl_cmd..fs.Q(url).." > "..fs.Q(filename)))
126 end 126 end