Skip to content

cut: preserve partial records when an input read fails - #17069

Open
limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:fix/cut-input-read-errors
Open

limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:fix/cut-input-read-errors

Conversation

@limadog9

@limadog9 limadog9 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Finish the current record with the bytes already read, report the failing input, and continue with later operands. This prevents cut from dropping selected text or joining records across files. On Linux and Android, report the actual directory read error.

Both cut checks in GNU 9.12's misc/read-errors.sh now pass. The script went from 36 failures to 34. All four dedicated GNU cut tests passed before and after. All 92 Linux integration tests and 22 unit tests passed.

Addresses the cut portion of #10890 and #14705.

Let each selection mode finish the bytes already read before reporting the error against the input operand. Continue with later operands, including another read from standard input. On Linux and Android use the read error for directories.

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.

1 participant