Mercurial > prosody-modules
comparison mod_firewall/mod_firewall.lua @ 6509:f61564e11d3b
various: Adjust for loop variables becoming constants in Lua 5.5
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 07 Apr 2026 14:30:31 +0200 |
| parents | ce716e5e0fee |
| children | 0f61d13ebbde |
comparison
equal
deleted
inserted
replaced
| 6508:3044e14fcaa0 | 6509:f61564e11d3b |
|---|---|
| 412 if not file then return nil, err; end | 412 if not file then return nil, err; end |
| 413 | 413 |
| 414 local state; -- nil -> "rules" -> "actions" -> nil -> ... | 414 local state; -- nil -> "rules" -> "actions" -> nil -> ... |
| 415 | 415 |
| 416 local line_hold; | 416 local line_hold; |
| 417 for line in file:lines() do | 417 for rawline in file:lines() do |
| 418 line = line:match("^%s*(.-)%s*$"); | 418 local line = rawline:match("^%s*(.-)%s*$"); |
| 419 if line_hold and line:sub(-1,-1) ~= "\\" then | 419 if line_hold and line:sub(-1,-1) ~= "\\" then |
| 420 line = line_hold..line; | 420 line = line_hold..line; |
| 421 line_hold = nil; | 421 line_hold = nil; |
| 422 elseif line:sub(-1,-1) == "\\" then | 422 elseif line:sub(-1,-1) == "\\" then |
| 423 line_hold = (line_hold or "")..line:sub(1,-2); | 423 line_hold = (line_hold or "")..line:sub(1,-2); |
