mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-25 12:08:21 +01:00
Merge pull request #157 from mpeterv/ltn12-lua53
Fix error in ltn12 under Lua 5.3
This commit is contained in:
commit
280e1d68a6
@ -9,6 +9,7 @@
|
||||
-----------------------------------------------------------------------------
|
||||
local string = require("string")
|
||||
local table = require("table")
|
||||
local unpack = unpack or table.unpack
|
||||
local base = _G
|
||||
local _M = {}
|
||||
if module then -- heuristic for exporting a global package table
|
||||
@ -42,7 +43,7 @@ end
|
||||
-- (thanks to Wim Couwenberg)
|
||||
function filter.chain(...)
|
||||
local arg = {...}
|
||||
local n = select('#',...)
|
||||
local n = base.select('#',...)
|
||||
local top, index = 1, 1
|
||||
local retry = ""
|
||||
return function(chunk)
|
||||
|
@ -61,7 +61,7 @@ function _M.parse_from(from)
|
||||
end
|
||||
|
||||
function _M.split_mbox(mbox_s)
|
||||
mbox = {}
|
||||
local mbox = {}
|
||||
mbox_s = string.gsub(mbox_s, "\r\n", "\n") .."\n\nFrom \n"
|
||||
local nj, i, j = 1, 1, 1
|
||||
while 1 do
|
||||
|
@ -74,7 +74,7 @@ function metat.__index:command(cmd, arg)
|
||||
end
|
||||
|
||||
function metat.__index:sink(snk, pat)
|
||||
local chunk, err = c:receive(pat)
|
||||
local chunk, err = self.c:receive(pat)
|
||||
return snk(chunk, err)
|
||||
end
|
||||
|
||||
|
@ -219,6 +219,7 @@ end
|
||||
-- corresponding absolute url
|
||||
-----------------------------------------------------------------------------
|
||||
function _M.absolute(base_url, relative_url)
|
||||
local base_parsed
|
||||
if base.type(base_url) == "table" then
|
||||
base_parsed = base_url
|
||||
base_url = _M.build(base_parsed)
|
||||
|
Loading…
Reference in New Issue
Block a user