瀏覽代碼

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

Bart van Strien 7 年之前
父節點
當前提交
f32237a524
共有 1 個文件被更改,包括 1 次插入1 次删除
  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