Skip to content

#335 - LineReaderTask: do not lose the last line of a file without final line break - #336

Open
njoubert-cleverage wants to merge 2 commits into
mainfrom
335
Open

njoubert-cleverage wants to merge 2 commits into
mainfrom
335

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #335.

  • LineReaderTask::next() (also used by InputLineReaderTask) stops the iteration when SplFileObject::valid() is false instead of when eof() is true: with READ_AHEAD, the end of the file is reached as soon as the last line is read, so the last line of a file without final line break was never emitted.
  • New test with l1\n\nl3\r\nl4, for both tasks.

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None: files ending with a line break are read as before.

🤖 Generated with Claude Code

njoubert-cleverage and others added 2 commits October 22, 2026 17:13
…to read instead of at the end of the file, so that the last line of a file that does not end with a line break is no longer lost. Add tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LineReaderTask: the last line is lost when the file does not end with a line break

1 participant