aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2010-11-18 22:46:05 -0200
committerHisham Muhammad <hisham@gobolinux.org>2010-11-18 22:46:05 -0200
commit6d7b31ad8d340ec237b07664070ef325ea6314a4 (patch)
tree49b265200f902951168fde21d9d4cee15ab2871d
parent7f79d5a020d2345704193aeb3cb17aee99c87b4a (diff)
downloadluarocks-6d7b31ad8d340ec237b07664070ef325ea6314a4.tar.gz
luarocks-6d7b31ad8d340ec237b07664070ef325ea6314a4.tar.bz2
luarocks-6d7b31ad8d340ec237b07664070ef325ea6314a4.zip
Remove newline from string when reading from md5 or openssl. Closes #4.
-rw-r--r--src/luarocks/fs/unix/tools.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua
index a67dca49..bb7e48db 100644
--- a/src/luarocks/fs/unix/tools.lua
+++ b/src/luarocks/fs/unix/tools.lua
@@ -302,14 +302,14 @@ function get_md5(file, md5sum)
302 end 302 end
303 elseif cfg.md5checker == "openssl" then 303 elseif cfg.md5checker == "openssl" then
304 local pipe = io.popen("openssl md5 "..file) 304 local pipe = io.popen("openssl md5 "..file)
305 computed = pipe:read("*a") 305 computed = pipe:read("*l")
306 pipe:close() 306 pipe:close()
307 if computed then 307 if computed then
308 computed = computed:sub(-32) 308 computed = computed:sub(-32)
309 end 309 end
310 elseif cfg.md5checker == "md5" then 310 elseif cfg.md5checker == "md5" then
311 local pipe = io.popen("md5 "..file) 311 local pipe = io.popen("md5 "..file)
312 computed = pipe:read("*a") 312 computed = pipe:read("*l")
313 pipe:close() 313 pipe:close()
314 if computed then 314 if computed then
315 computed = computed:sub(-32) 315 computed = computed:sub(-32)