You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
${x//\\\\/@} replaces each backslash, not each pair #3963
niubash 1.5.0 (rubash 29bbf52); also on master fb025fc. Windows 11.
Found while trying niu as the shell for Claude Code's Bash tool; the issue was drafted with Claude and the reproductions were run on the versions above.
CAPTAIN-VERIFY (2026-11-20): confirmed against the GNU bash 5.3.20 oracle. Master reproduced the report exactly (a@@b@c); GNU gives a@b\c. Root cause: the pattern decoder collapses a source \\ pair to one literal-backslash marker, but the literal (non-glob) fast path folded adjacent markers a second time, halving the pattern — so each single backslash matched instead of each pair. The same folding was reused by the glob path's tail computation.
Fixed in #3974 (strict 1:1 marker conversion, pair-folding pass deleted, unit regression added): 16/16 probes across the adjacent forms now match the oracle byte for byte. Closing as completed. Thank you for the precise report — the repro pinned the face immediately.
Activity
ShiomiHC commentedon Nov 20, 2026
A related case with a single-quoted pattern:
niu:
x\\/y, Git Bash 5.3.15:x/y."${a//"\\/"/\/}"givesx/yin both.fix(patsub): literal-backslash pattern markers convert one-for-one (R…
caomengxuan666 commentedon Nov 20, 2026
CAPTAIN-VERIFY (2026-11-20): confirmed against the GNU bash 5.3.20 oracle. Master reproduced the report exactly (
a@@b@c); GNU givesa@b\c. Root cause: the pattern decoder collapses a source\\pair to one literal-backslash marker, but the literal (non-glob) fast path folded adjacent markers a second time, halving the pattern — so each single backslash matched instead of each pair. The same folding was reused by the glob path's tail computation.Fixed in #3974 (strict 1:1 marker conversion, pair-folding pass deleted, unit regression added): 16/16 probes across the adjacent forms now match the oracle byte for byte. Closing as completed. Thank you for the precise report — the repro pinned the face immediately.