mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
lualoader: Add comment on trailing space, don't operate on nil
Functionally, the latter error wouldn't necessarily hurt anything. io.write will just error out as it's not passed a valid file handle. Still, we can do better than that.
This commit is contained in:
parent
483f0a33f3
commit
d930cdc295
1 changed files with 8 additions and 2 deletions
|
|
@ -141,8 +141,14 @@ local function check_nextboot()
|
|||
end
|
||||
|
||||
local nfile = io.open(nextboot_file, 'w')
|
||||
io.write(nfile, "nextboot_enable=\"NO\" ")
|
||||
io.close(nfile)
|
||||
if nfile ~= nil then
|
||||
-- We're overwriting the first line of the file, so we need the
|
||||
-- trailing space to account for the extra character taken up by
|
||||
-- the string nextboot_enable="YES" -- our new end quotation
|
||||
-- mark lands on the S.
|
||||
io.write(nfile, "nextboot_enable=\"NO\" ")
|
||||
io.close(nfile)
|
||||
end
|
||||
end
|
||||
|
||||
-- Module exports
|
||||
|
|
|
|||
Loading…
Reference in a new issue