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

support Lua 5.3

parent 8341a2f6
......@@ -299,7 +299,9 @@ if not call(
local data
repeat
-- Lua 5.2 compatibility: prefix with *
data = stdout:read('*a')
io.stdout:write(data)
until data == ''
stdout:close()
......
......@@ -289,8 +289,8 @@ function M.Rule:zoneoptfrags()
local izones = self[self:direction('in')] or {}
local ozones = self[self:direction('out')] or {}
for i = 1,math.max(1, table.maxn(izones)) do
for j = 1,math.max(1, table.maxn(ozones)) do
for i = 1,math.max(1, #izones) do
for j = 1,math.max(1, #ozones) do
extend(res, zonepair(izones[i], ozones[j]))
end
end
......
--[[
Policy file handling for Alpine Wall
Copyright (C) 2012-2016 Kaarle Ritvanen
Copyright (C) 2012-2017 Kaarle Ritvanen
See LICENSE file for license details
]]--
......@@ -71,7 +71,10 @@ function Policy:init() self.enabled = self.type == 'mandatory' end
function Policy:load()
local file = io.open(self.path)
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()
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