Skip to content

docs: #878 CR nits rework — correct command.def/printf.def coordinates (#888 review) - #933

Merged
caomengxuan666 merged 2 commits into
masterfrom
cr-fix/888
Oct 20, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
cr-fix/888

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Summary

Rework of #888 implementing the review findings in comment 6289975215 (and the two earlier rounds, all REQUEST-CHANGES for the same 3-item fix list). Branched from PR #888 head 3e291c80; the original commit by @a-rookie-of-C-language is preserved on this branch — original author keeps priority, first-come-first-served. maintainerCanModify on #888 is false, so this lands as a new PR; cross-linked both ways.

All coordinates verified byte-for-byte against vendored third_party/bash @ b460816 (bash-5.3 patch 15):

Fix list (from the review):

  1. command.def no-operand early return: 96-99 → 96-97 in type_builtin.rs:51, command_substitution_values.rs:96, tests/regression.rs:1855. Vendored: 96 = if (list == 0), 97 = return (EXECUTION_SUCCESS);, 98 is blank, 99 is #if defined (RESTRICTED_SHELL) — the early return is 96-97 exactly (this is also what CR nits 汇总 v2(#854/#869/#870/#873 四轮):坐标勘误×2、双点钉死、死字段、注释三件、陈旧注释、引号默认值残差 #878 item 1 pinned).
  2. printf.def asciicode(): src/builtins/printf/number.rs:133 contract comment still said (printf.def:1519-1544) → now 1520-1543, matching the already-correct printf_tests.rs:479 (1519 = return-type line, 1520 = asciicode (void), 1543 = closing }).
  3. command.def -p restricted refusal: tests/issue804…rs:13 98-104 → 100-104, with the convention stated inline — 100-104 is the use_standard_path && restricted if-block (refusal statements at 102-103); the enclosing #if/#endif guard spans 99-105.

Residual-coordinate grep (review acceptance criterion) — clean:

$ grep -rn -E "96-99|98-104|95-96|97-103|1519-1544" src tests
(no matches)

Everything else on #888 stands unchanged: the run_rubash_in stale-env comment rewrite (verified against run_suite_snapshot's env_clear + whitelist + pinned THIS_SH/TMPDIR channel), printf_tests.rs:479, and the 5-file/comment-only/zero-behavior scope.

Refs #878, #888 — supersedes #888 if landed first.

Test plan

  • Vendored third_party/bash @ b460816 re-read: command.def:96-97 early return, command.def:100-104 refusal block (99-105 guard), printf.def:1520-1543 asciicode()
  • grep -rn -E "96-99|98-104|95-96|97-103|1519-1544" src tests → zero hits
  • rustfmt --edition 2021 --check on all 5 touched files → clean
  • cargo check --tests → finished, warnings unchanged (all pre-existing in unrelated files)
  • Diff remains comment-only, zero behavior change, submodule pointer untouched

Generated with Devin

arookieofc and others added 2 commits October 19, 2026 22:42
…regression.rs env comment

Coordinate errata (verified against vendored third_party/bash):
- command.def: the 'if (list == 0) return' early return sits at 96-99,
  not 95-96 (type_builtin.rs, command_substitution_values.rs,
  tests/regression.rs); the -p restricted refusal block is 98-104, not
  97-103 (issue804 test header).
- printf.def asciicode(): the body is 1520-1543, not 1519-1544
  (printf_tests.rs).

Stale comment (rubash#864 nit): tests/regression.rs run_rubash_in's
parenthetical still claimed suite snapshots 'deliberately keep the
ambient env'. The snapshot path switched to the same airtight channel
(env_clear + machine whitelist + pinned THIS_SH/TMPDIR) when ambient
leakage was found to make recorded bytes machine-dependent; the
parenthetical now says so and points at the sibling comment.

Note on item 7 (the quoted-default split residue): probed — GNU prints
'a b<W>' as one field, rubash splits it into 'a' and 'b<W>'. That is a
real word-splitting semantic divergence (same function neighborhood as
the byte/char fix in rubash#876), not a comment nit; tracked for a
dedicated fix rather than a partial change here.

Comment-only; zero behavior change; build + fmt + tests/regression
78/78 green.
…888 review

Implements the review findings on #888 (comment
6289975215), verified byte-for-byte against vendored third_party/bash
@ b460816 (bash-5.3 patch 15):

- command.def: the `if (list == 0)` no-operand early return is 96-97
  (96 = if, 97 = return; 98 is blank, 99 is `#if RESTRICTED_SHELL`),
  not 96-99 — fixed in type_builtin.rs, command_substitution_values.rs,
  tests/regression.rs.
- command.def: the -p restricted refusal is the use_standard_path &&
  restricted if-block at 100-104 (the enclosing #if/#endif guard spans
  99-105), not 98-104 — issue804 test header now states the
  if-block/guard convention inline.
- printf.def: asciicode() is 1520-1543 (function-name line to closing
  brace); the contract comment in printf/number.rs:133 still carried
  the old 1519-1544 — fixed to match printf_tests.rs:479.

Residual-coordinate grep is clean: no 96-99/98-104/95-96/97-103/
1519-1544 left in src/ or tests/. Comment-only; zero behavior change;
rustfmt clean on all touched files; cargo check --tests warning set
unchanged.

Refs #878

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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