Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug where logs over 2 GB would be skipped.
On 32-bit systems, SplFileInfo::getSize() can return a negative integer when the file size exceeds 2 GB. This means that checking for empty files by asking if getSize() < 1 isn't reliable. Lets explicitly compare it to zero instead. Possible risks: A commenter on php.net claims that getSize() can return false if the file doesn't exist (documentation claims otherwise). We should never encounter that situation because we already check if the file specified as the --log argument exists, and we can (probably?) assume that iterating through the directory specified as the --dir argument will not return non-existent files.
- Loading branch information