aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/tools/zip.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/luarocks/tools/zip.lua b/src/luarocks/tools/zip.lua
index caeb4ac9..36adc7e2 100644
--- a/src/luarocks/tools/zip.lua
+++ b/src/luarocks/tools/zip.lua
@@ -5,8 +5,6 @@ local zlib = require("zlib")
5local fs = require("luarocks.fs") 5local fs = require("luarocks.fs")
6local dir = require("luarocks.dir") 6local dir = require("luarocks.dir")
7 7
8local size_buf = 65535
9
10local function number_to_bytestring(number, nbytes) 8local function number_to_bytestring(number, nbytes)
11 local out = {} 9 local out = {}
12 for i = 1, nbytes do 10 for i = 1, nbytes do
@@ -115,8 +113,8 @@ local function zipwriter_add(self, file)
115 err = "error opening "..file.." for reading" 113 err = "error opening "..file.." for reading"
116 end 114 end
117 end 115 end
118 while ok do 116 if ok then
119 local buf = fin:read(size_buf) 117 local buf = fin:read("*a")
120 if not buf then 118 if not buf then
121 break 119 break
122 end 120 end
@@ -190,7 +188,7 @@ function new_zipwriter(name)
190 188
191 local zw = {} 189 local zw = {}
192 190
193 zw.ziphandle = io.open(name, "w") 191 zw.ziphandle = io.open(name, "wb")
194 if not zw.ziphandle then 192 if not zw.ziphandle then
195 return nil 193 return nil
196 end 194 end