diff options
author | Pierre Chapuis <catwell@archlinux.us> | 2012-09-17 18:30:26 +0200 |
---|---|---|
committer | Pierre Chapuis <catwell@archlinux.us> | 2012-09-17 23:44:04 +0200 |
commit | ffddaf4a2e2c33f805ee072c6f78fe987fd35f87 (patch) | |
tree | cb59a9e43a22ecf93a92d09ef49903ddc2d80a60 /src/ltn12.lua | |
parent | a40222246430dcaf55095dcdccf7860799e0fee1 (diff) | |
download | luasocket-ffddaf4a2e2c33f805ee072c6f78fe987fd35f87.tar.gz luasocket-ffddaf4a2e2c33f805ee072c6f78fe987fd35f87.tar.bz2 luasocket-ffddaf4a2e2c33f805ee072c6f78fe987fd35f87.zip |
fix use of arg in ltn12
Diffstat (limited to 'src/ltn12.lua')
-rw-r--r-- | src/ltn12.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ltn12.lua b/src/ltn12.lua index b7f9a21..d999e93 100644 --- a/src/ltn12.lua +++ b/src/ltn12.lua | |||
@@ -37,7 +37,8 @@ end | |||
37 | -- chains a bunch of filters together | 37 | -- chains a bunch of filters together |
38 | -- (thanks to Wim Couwenberg) | 38 | -- (thanks to Wim Couwenberg) |
39 | function filter.chain(...) | 39 | function filter.chain(...) |
40 | local n = table.getn(arg) | 40 | local arg = {...} |
41 | local n = #arg | ||
41 | local top, index = 1, 1 | 42 | local top, index = 1, 1 |
42 | local retry = "" | 43 | local retry = "" |
43 | return function(chunk) | 44 | return function(chunk) |
@@ -185,6 +186,7 @@ end | |||
185 | -- other, as if they were concatenated | 186 | -- other, as if they were concatenated |
186 | -- (thanks to Wim Couwenberg) | 187 | -- (thanks to Wim Couwenberg) |
187 | function source.cat(...) | 188 | function source.cat(...) |
189 | local arg = {...} | ||
188 | local src = table.remove(arg, 1) | 190 | local src = table.remove(arg, 1) |
189 | return function() | 191 | return function() |
190 | while src do | 192 | while src do |