Fixed bug when last line of file was missing if using readLine

This commit is contained in:
hbomb79 2017-05-03 13:20:32 +12:00
parent cb4cacd37b
commit abbf7085b0

View file

@ -491,9 +491,9 @@ function VFS.open( path, mode )
handle.readLine = function()
if #content == 0 then return end
local line, rest = content:match "^([^\n\r]*)[\n\r](.*)$"
local line, rest = content:match "^([^\n\r]*)(.*)$"
content = rest or ""
content = rest and rest:gsub("^[\n\r]", "") or ""
return line or content
end