Skip to content

ptx: accept invalid UTF-8 input and trailing backslash regexps - #14032

Open
sylvestre wants to merge 1 commit into
uutils:mainfrom
sylvestre:fix-gnu-ptx-overrun
Open

ptx: accept invalid UTF-8 input and trailing backslash regexps#14032
sylvestre wants to merge 1 commit into
uutils:mainfrom
sylvestre:fix-gnu-ptx-overrun

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

ptx aborted with "stream did not contain valid UTF-8" on input that is not valid UTF-8, while GNU ptx operates on bytes and processes it fine. Input is now read as bytes and decoded lossily.

Should make test tests/ptx/ptx-overrun.sh pass
#13841

Copilot AI lite review requested due to automatic review settings August 19, 2026 16:50

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

ptx aborted with "stream did not contain valid UTF-8" on input that is
not valid UTF-8, while GNU ptx operates on bytes and processes it fine.
Input is now read as bytes and decoded lossily.

Additionally, a regexp ending in a lone backslash (e.g. -S 'foo\') was
rejected by the regex crate as an incomplete escape sequence, whereas
GNU treats it as a literal backslash. Such a trailing backslash is now
doubled before compiling the pattern, for both -S and -W.

Should make test tests/ptx/ptx-overrun.sh pass
uutils#13841
Copilot AI review requested due to automatic review settings August 19, 2026 17:01
@sylvestre
sylvestre force-pushed the fix-gnu-ptx-overrun branch from 5a00998 to 2d2cdf2 Compare August 19, 2026 17:01

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants