diff options
| author | Ignacio Burgueño <iburgueno@gmail.com> | 2011-06-29 20:37:21 -0300 |
|---|---|---|
| committer | Ignacio Burgueño <iburgueno@gmail.com> | 2011-06-29 20:37:21 -0300 |
| commit | 7849616e0d9c68b2cd15dfc8264a538f81dc28f4 (patch) | |
| tree | 344c93eef83dc32644a965167ccb7a1a37eebeda | |
| parent | 5a7a71236d9119befa1935c94ca8bb80b862626c (diff) | |
| download | luarocks-7849616e0d9c68b2cd15dfc8264a538f81dc28f4.tar.gz luarocks-7849616e0d9c68b2cd15dfc8264a538f81dc28f4.tar.bz2 luarocks-7849616e0d9c68b2cd15dfc8264a538f81dc28f4.zip | |
Read the whole file at once
| -rw-r--r-- | src/luarocks/tools/zip.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/luarocks/tools/zip.lua b/src/luarocks/tools/zip.lua index caeb4ac9..3afec53b 100644 --- a/src/luarocks/tools/zip.lua +++ b/src/luarocks/tools/zip.lua | |||
| @@ -5,8 +5,6 @@ local zlib = require("zlib") | |||
| 5 | local fs = require("luarocks.fs") | 5 | local fs = require("luarocks.fs") |
| 6 | local dir = require("luarocks.dir") | 6 | local dir = require("luarocks.dir") |
| 7 | 7 | ||
| 8 | local size_buf = 65535 | ||
| 9 | |||
| 10 | local function number_to_bytestring(number, nbytes) | 8 | local 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 |
