Repository navigation
docs: #878 CR nits rework — correct command.def/printf.def coordinates (#888 review) - #933
Merged
Merged
Conversation
…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>
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.
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.maintainerCanModifyon #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):
command.defno-operand early return:96-99→96-97intype_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).printf.defasciicode():src/builtins/printf/number.rs:133contract comment still said(printf.def:1519-1544)→ now1520-1543, matching the already-correctprintf_tests.rs:479(1519 = return-type line, 1520 =asciicode (void), 1543 = closing}).command.def-prestricted refusal:tests/issue804…rs:1398-104→100-104, with the convention stated inline — 100-104 is theuse_standard_path && restrictedif-block (refusal statements at 102-103); the enclosing#if/#endifguard spans 99-105.Residual-coordinate grep (review acceptance criterion) — clean:
Everything else on #888 stands unchanged: the
run_rubash_instale-env comment rewrite (verified againstrun_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
third_party/bash@b460816re-read:command.def:96-97early return,command.def:100-104refusal block (99-105 guard),printf.def:1520-1543asciicode()grep -rn -E "96-99|98-104|95-96|97-103|1519-1544" src tests→ zero hitsrustfmt --edition 2021 --checkon all 5 touched files → cleancargo check --tests→ finished, warnings unchanged (all pre-existing in unrelated files)Generated with Devin