Browse Source

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

Bart van Strien 7 years ago
parent
commit
f32237a524
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/filesystem/wrap_File.cpp

+ 1 - 1
src/modules/filesystem/wrap_File.cpp

@@ -324,7 +324,7 @@ int w_File_lines_i(lua_State *L)
 		end = reinterpret_cast<const char*>(memchr(start, '\n', len));
 		end = reinterpret_cast<const char*>(memchr(start, '\n', len));
 	}
 	}
 
 
-	if (!end && file->isEOF())
+	if (!end)
 		end = buffer+len-1;
 		end = buffer+len-1;
 
 
 	// We've found the next line, update our offset upvalue and return
 	// We've found the next line, update our offset upvalue and return