Prevent error in File:lines if the last line does not end with a newline (resolves #1383)

This commit is contained in:
Bart van Strien
2018-02-17 14:55:39 +01:00
parent 8e83834722
commit f32237a524
+1 -1
View File
@@ -324,7 +324,7 @@ int w_File_lines_i(lua_State *L)
end = reinterpret_cast<const char*>(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