Mercurial > prosody-modules
comparison mod_dnsbl/mod_dnsbl.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 | 1213145e27fc |
| children |
comparison
equal
deleted
inserted
replaced
| 6508:3044e14fcaa0 | 6509:f61564e11d3b |
|---|---|
| 50 module:log("error", "Failed to read file: %s", err); | 50 module:log("error", "Failed to read file: %s", err); |
| 51 return t; | 51 return t; |
| 52 end | 52 end |
| 53 | 53 |
| 54 local n_line, n_added = 0, 0; | 54 local n_line, n_added = 0, 0; |
| 55 for line in f:lines() do | 55 for rawline in f:lines() do |
| 56 n_line = n_line + 1; | 56 n_line = n_line + 1; |
| 57 line = line:gsub("#.+$", ""):match("^%s*(.-)%s*$"); | 57 local line = rawline:gsub("#.+$", ""):match("^%s*(.-)%s*$"); |
| 58 if line == "" then -- luacheck: ignore 542 | 58 if line == "" then -- luacheck: ignore 542 |
| 59 -- Skip | 59 -- Skip |
| 60 else | 60 else |
| 61 local parsed_ip, parsed_bits = parse_cidr(line); | 61 local parsed_ip, parsed_bits = parse_cidr(line); |
| 62 if not parsed_ip then | 62 if not parsed_ip then |
