mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
Problem - With , uutils csplit failed to create the final empty output file when the last split point consumed the trailing input. - GNU csplit always creates a final segment after processing patterns; with , that empty final segment is elided. - This broke the GNU test (tests/csplit/csplit-suppress-matched.pl) and the scenario: Root cause - Final-file creation was conditional on there being remaining input after pattern processing. If none remained, no final file was created, contrary to GNU semantics. Fix (minimal, targeted) - In , after : - If there is remaining input, always create a final split and copy the remainder, then finish. - Else, if all patterns were integer-based and is set, create a final (possibly empty) split and finish; elides it when is set. Tests (Rust integration) - Added two Rust tests under to lock down GNU-compatible behavior: - (expects sizes 2,2,2,0 and a final empty ) - (final empty file is correctly elided) Verification - All tests pass locally. The originally reported case now matches GNU. Relation to PR #7806 - #7806 proposes a broader refactor to fix multiple issues, but remains a draft and notes remaining GNU suppress-matched differences. - This PR provides a small, reviewable fix specifically for #7286, plus precise integration tests to safeguard behavior. Fixes #7286 |
||
|---|---|---|
| .. | ||
| benches/factor | ||
| by-util | ||
| fixtures | ||
| uutests | ||
| test_localization_and_colors.rs | ||
| test_util_name.rs | ||
| tests.rs | ||