From f32237a524970a877cabf8a4660e92f07217614a Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Sat, 17 Feb 2018 14:55:39 +0100 Subject: [PATCH] Prevent error in File:lines if the last line does not end with a newline (resolves #1383) --- src/modules/filesystem/wrap_File.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/filesystem/wrap_File.cpp b/src/modules/filesystem/wrap_File.cpp index ce29765e7..4631af8bb 100644 --- a/src/modules/filesystem/wrap_File.cpp +++ b/src/modules/filesystem/wrap_File.cpp @@ -324,7 +324,7 @@ int w_File_lines_i(lua_State *L) end = reinterpret_cast(memchr(start, '\n', len)); } - if (!end && file->isEOF()) + if (!end) end = buffer+len-1; // We've found the next line, update our offset upvalue and return