Lua io: file:read now returns nil when seek is at eof, to match original module

This commit is contained in:
ihaveahax 2026-03-26 21:57:02 -05:00 committed by d0k3
parent d6c537a626
commit ab72328652

View File

@ -143,6 +143,9 @@ function file:read(...)
table.insert(to_return, data)
else
-- assuming this is a number...
if self._seek >= self._size then
return nil
end
local data = fs.read_file(self._filename, self._seek, v)
self._seek = self._seek + string.len(data)
table.insert(to_return, data)