Skip to content

fix(#340): Preserve capture after hex escape#344

Open
JSap0914 wants to merge 1 commit into
chmln:masterfrom
JSap0914:fix/340-preserve-capture-after-escape
Open

fix(#340): Preserve capture after hex escape#344
JSap0914 wants to merge 1 commit into
chmln:masterfrom
JSap0914:fix/340-preserve-capture-after-escape

Conversation

@JSap0914

Copy link
Copy Markdown

Summary

Fixes #340.

Hex escape parsing advanced one character too far, so a replacement such as $1\x00$2 consumed the $ before the second capture and produced a literal 2. Advance exactly the number of parsed hex digits instead.

Verification

  • Added a focused unit regression for a character following \x00.
  • Added an end-to-end replacement regression matching the issue input.
  • Ran the full workspace test suite and Clippy with warnings denied.
  • Confirmed the CLI emits a NUL byte immediately followed by the second capture.

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.

sd fails to substitute capture when not surrounded by whitespace

1 participant