Skip to content

csplit: avoid hangs after empty numeric splits - #15729

Open
limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:fix/csplit-negative-offset-hang-15653
Open

limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:fix/csplit-negative-offset-hang-15653

Conversation

@limadog9

Copy link
Copy Markdown
Contributor

Clear rewind mode before regex searches to prevent hangs after empty numeric splits. Adds four regression cases; all 155 tests pass.

Closes #15653.

Comment thread tests/by-util/test_csplit.rs Outdated
let (at, mut ucmd) = at_and_ucmd!();
ucmd.args(&["-", "/2/", "2", pattern])
.pipe_in("1\n2\n3\n")
.timeout(std::time::Duration::from_secs(10))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this? the default timeout already catches a hang

@limadog9
limadog9 force-pushed the fix/csplit-negative-offset-hang-15653 branch from 2d02f15 to 96dacb6 Compare October 25, 2026 11:44
@limadog9
limadog9 force-pushed the fix/csplit-negative-offset-hang-15653 branch from 96dacb6 to ac66477 Compare October 25, 2026 13:33

This branch has not been deployed

No deployments
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: hangs on a /REGEX/-N pattern after a line-number pattern that names the line a regex stopped at

2 participants