Repository navigation
WIP: fix(carrier): patsub typed-glyph escape pair (#1927) + numbered here-string guard strip (#1965) - #2022
Conversation
… arms (rubash#1965) A numbered-fd here-string (0<<<) stores its word as already-decoded text whose $'...' blanks carry the U+E401 ANSI_C_IFS_GUARD carrier behind STORAGE_WORD_PREFIX. The canonical funnel (expand_heredoc_redirect_text -> expand_stored_here_string_word) strips the guard at the value boundary; the two stdin_string ladders' storage arms decoded/expanded without the strip, so on the pipeline staging route the guard byte leaked end-to-end into the delivered stream (cat 0<<< $'a\tb' | od showed an extra ee 90 81). The mut ladder now routes through expand_stored_here_string_word itself; the &self ladder applies the identical E400-aware strip to its decode-or-expand result. A user-typed U+E401 arrives E400-escaped and stays data. GNU: the here-string word is written to the pipe as data bytes plus a trailing newline (redir.c here_document_to_fd); the guard is internal transport and never observable. Regression pins: tests/issue1965_numbered_fd_herestring_guard_regressions.rs (three leak shapes + typed-E401 data pin + direct/plain/comsub controls), byte-verified against GNU bash 5.3.20 under LC_ALL=C.utf8.
…atsub mark pass (rubash#1927)
A registry-zone glyph typed literally into a patsub replacement body
leaked a stray U+E400 in front of the glyph (${v/b/<U+E312>x} printed
U+E400 U+E312 x; GNU prints U+E312 x). Script entry escaping
(bytes_to_script_text / command_string_entry_text) already
E400-escapes every typed zone glyph, so the replacement text the mark
pass walks carries the glyph as a LITERAL_CHAR_ESCAPE pair; the
per-char literal arms escaped each half a second time and the output
boundary's single decode left one introducer over. This is the
residual the #843 fix missed: its $'\uE312' spelling shapes never
pass through entry escaping.
The mark walks (both quote-marking passes and their literal-copy
arms: quoted spans, backslash escapes, the $-fallthrough, ANSI-C span
body collection) now recognize an existing pair via
push_existing_literal_pair and copy it verbatim as a unit — the same
rule the decoded-ANSI-C path already used. The E400+E000 pair is
excluded: U+E000 owns the raw-byte pair protocol and keeps its exact
prior handling. GNU: the replacement side is expanded as its own word
and its characters are plain data (subst.c:3950
expand_string_for_patsub); the carrier layer is the CTLESC port's
internal discipline and stays invisible in the output bytes.
Regression pins: tests/issue1927_patsub_typed_glyph_regressions.rs
(8 pins, byte-exact, GNU bash 5.3.20 under LC_ALL=C.utf8), including
the pre-existing issue843 target's literal_typed_glyph shape, the
adjacent-glyph pair walk, and a typed-E000 unchanged pin.
… table with #1898 Master advanced eight PRs while this family was in flight. The one semantic intersection is PR #2011 (S5 registry faces, niubash#627): it added special_dev_entries() — the listable /dev table — with zero/full deliberately absent and a consistency pin stating that a future /dev/zero simulation (audit D5) must update the table in the same change. #1898 is that simulation: the table now lists zero/full as leaf entries and the doc comment records the move. Everything else auto-merged cleanly (notably #2022's #1965 guard-strip alongside #1966, and #2010's -D warnings hygiene). Verified on the merged tree: cargo check --all-targets -D warnings is clean for the library and every target this family touches; the single remaining error (dead 'status' field in tests/issue1941_1948_sim_layer_option_regressions.rs) is byte-identical to master 1f007cc — master's own debt, not this branch's.
|
Pin update (commit b742da0, force-pushed): |
WIP: test(1927): adjacent-glyph pin via script file (follow-up to #2022)
Follow-up to unixwin#2022 (merged at the pre-amend head 1c64b5b): the adjacent typed-glyph pin (U+E400 followed by U+E312) cannot be expressed on the -c channel — a typed U+E400 immediately followed by another zone glyph is byte-indistinguishable from a materialized LITERAL_CHAR_ESCAPE transport pair, and command_string_entry_text preserves such a pair as protocol (its documented ambiguous seam), so the pin as merged fails deterministically (output loses the U+E400). The script-file channel (bytes_to_script_text) escapes each typed glyph on its own; the pin now writes the script to a temp file and runs it there. Verified: issue1927 target 8/8 with the fixed binary (slot run, -D warnings), and the same shape is byte-identical to GNU 5.3.20 via the file channel. Test-only; no product code change.
Carrier batch, two independent one-commit fixes. Full report:
~/workspace/fix-carrier-batch/REPORT.md.#1965 — numbered-fd here-string leaks U+E401 on the pipeline staging route
0<<<stores already-decoded text whose $'...' blanks carry the ANSI_C_IFS_GUARD carrier. The canonical funnel strips it at the value boundary (expand_stored_here_string_word); the twostdin_string_for_commandladders' storage arms did not. Mut ladder now routes through the funnel function; the &self ladder applies the identical E400-aware strip. Typed U+E401 (E400-escaped) stays data.Fixes #1965
#1927 — patsub replacement body leaks U+E400 before a literal typed glyph
Entry escaping already turns a typed zone glyph into a LITERAL_CHAR_ESCAPE pair; the mark pass escaped each half again, and the output boundary decodes once — one stray introducer per typed glyph (residual of #843, whose $'\u' spelling shapes never pass entry escaping). All literal-copy arms of the mark walks now copy an existing pair verbatim as a unit (
push_existing_literal_pair); the E400+E000 raw-byte pair keeps its exact prior handling.Fixes #1927
Gates