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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329901
@ -141,8 +141,14 @@ local function check_nextboot()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local nfile = io.open(nextboot_file, 'w')
|
local nfile = io.open(nextboot_file, 'w')
|
||||||
io.write(nfile, "nextboot_enable=\"NO\" ")
|
if nfile ~= nil then
|
||||||
io.close(nfile)
|
-- 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
|
end
|
||||||
|
|
||||||
-- Module exports
|
-- Module exports
|
||||||
|
Loading…
Reference in New Issue
Block a user