Repository navigation
fix(sed): GNU character escapes, -z joins, unreadable inputs and per-line loop budget - #2600
Merged
Merged
Conversation
…line loop budget Claude-Session: https://claude.ai/code/session_01VscpEzxtqpCKx5eRMpywNj
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 6ff1725 | Commit Preview URL Branch Preview URL |
Oct 07 2026, 09:04 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
\xHH,\dNNN,\oNNNand\cXnow work in regexes, in replacements and iny. Each one always produces a literal character, sos/z/\x26/inserts&rather than the match (GNU bug 30794 semantics).\tand\nwork inside bracket expressions, so the commons/^[ \t]*//now strips tabs. Any other backslash inside brackets is still a literal member.-zmode.N,GandHjoin with NUL, andDandPsplit on NUL. With theMflag,^and$also match around NUL.sed: can't read X: ...) and skipped. The remaining files are still processed, and the exit status is 2.seq 3000 | sed '$!N;P;D'stopped after 1001 lines with a loop-limit warning. The uniq script (:b;$b;N;...;bb) had the same problem on long runs of duplicate lines. Loops that read no input (G;D,:a;s/^/x/;ta) are still stopped.Why
These come from the sed lane of the pseudo-linus Debian oracle bench. The truncation of
$!N;P;Dwas a real correctness bug on ordinary input sizes.Before
After
Risk
Low. The DoS bound is kept: a loop is still capped unless it consumes input, and consuming input is bounded by the input size. L-SED-005 is updated to describe this.
Checklist
cargo clippy -D warnings,cargo fmt; sed integration and spec tests passhttps://claude.ai/code/session_01VscpEzxtqpCKx5eRMpywNj
Generated by Claude Code