Skip to content

Commit

Permalink
Quote archive name when unpacking
Browse files Browse the repository at this point in the history
Also use vars.TAR instead of literal "tar" when unpacking .tar.bz2
  • Loading branch information
mpeterv committed Apr 14, 2016
1 parent ed22f45 commit fde1b07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/luarocks/fs/unix/tools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ function tools.unpack_archive(archive)

local ok
if archive:match("%.tar%.gz$") or archive:match("%.tgz$") then
ok = fs.execute_string(vars.GUNZIP.." -c "..archive.."|"..vars.TAR.." -xf -")
ok = fs.execute_string(vars.GUNZIP.." -c "..fs.Q(archive).." | "..vars.TAR.." -xf -")
elseif archive:match("%.tar%.bz2$") then
ok = fs.execute_string(vars.BUNZIP2.." -c "..archive.."|tar -xf -")
ok = fs.execute_string(vars.BUNZIP2.." -c "..fs.Q(archive).." | "..vars.TAR.." -xf -")
elseif archive:match("%.zip$") then
ok = fs.execute(vars.UNZIP, archive)
elseif archive:match("%.lua$") or archive:match("%.c$") then
Expand Down

0 comments on commit fde1b07

Please sign in to comment.