Commit 6189314d authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

support Lua 5.3

parent 8341a2f6
...@@ -299,7 +299,9 @@ if not call( ...@@ -299,7 +299,9 @@ if not call(
local data local data
repeat repeat
-- Lua 5.2 compatibility: prefix with *
data = stdout:read('*a') data = stdout:read('*a')
io.stdout:write(data) io.stdout:write(data)
until data == '' until data == ''
stdout:close() stdout:close()
......
...@@ -289,8 +289,8 @@ function M.Rule:zoneoptfrags() ...@@ -289,8 +289,8 @@ function M.Rule:zoneoptfrags()
local izones = self[self:direction('in')] or {} local izones = self[self:direction('in')] or {}
local ozones = self[self:direction('out')] or {} local ozones = self[self:direction('out')] or {}
for i = 1,math.max(1, table.maxn(izones)) do for i = 1,math.max(1, #izones) do
for j = 1,math.max(1, table.maxn(ozones)) do for j = 1,math.max(1, #ozones) do
extend(res, zonepair(izones[i], ozones[j])) extend(res, zonepair(izones[i], ozones[j]))
end end
end end
......
--[[ --[[
Policy file handling for Alpine Wall Policy file handling for Alpine Wall
Copyright (C) 2012-2016 Kaarle Ritvanen Copyright (C) 2012-2017 Kaarle Ritvanen
See LICENSE file for license details See LICENSE file for license details
]]-- ]]--
...@@ -71,7 +71,10 @@ function Policy:init() self.enabled = self.type == 'mandatory' end ...@@ -71,7 +71,10 @@ function Policy:init() self.enabled = self.type == 'mandatory' end
function Policy:load() function Policy:load()
local file = io.open(self.path) local file = io.open(self.path)
if not file then raise('Unable to read policy file '..self.path) end if not file then raise('Unable to read policy file '..self.path) end
local data = file:read('*all')
-- Lua 5.2 compatibility: prefix with *
local data = file:read('*a')
file:close() file:close()
local success, res = pcall(self.decode, data) local success, res = pcall(self.decode, data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment