Skip to content

csplit: don't add a newline if the file doesn't end with one #7901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 9, 2025

Conversation

Qelxiros
Copy link
Contributor

@Qelxiros Qelxiros commented May 8, 2025

closes #7126

BufRead::lines is inherently lossy in that it is impossible to know whether a line ended due to a newline or EOF. In this PR, I replaced it with a custom iterator using BufRead::read_until to keep track of the line endings manually.

Copy link

github-actions bot commented May 8, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@Qelxiros Qelxiros force-pushed the 7126-csplit-newline branch from bcd7dda to d782cc4 Compare May 8, 2025 02:17
Copy link

github-actions bot commented May 8, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Copy link

github-actions bot commented May 8, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

Copy link

github-actions bot commented May 8, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@Qelxiros Qelxiros requested a review from cakebaker May 9, 2025 00:07
@cakebaker cakebaker merged commit a752f73 into uutils:main May 9, 2025
70 checks passed
@cakebaker
Copy link
Contributor

Thanks!

RenjiSann pushed a commit to RenjiSann/coreutils that referenced this pull request May 23, 2025
…7901)

* csplit: don't add a newline if the file doesn't end with one

* refactor test

* refactor
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.

csplit: new line added automatically leads to inconsistency with GNU
2 participants