Repository navigation
fix(executor): decode the :? diagnostic message through the visible-text face (Refs #3260) - #3462
Merged
Merged
Conversation
…ext face (Refs #3260) Root cause: `${q:?...}` diagnostic message words keep quoted whitespace behind the IFS_GLUE carrier (\x1c) for field splitting; both `:?` diagnostic construction points printed the `expand_parameter_word` result raw, so the carrier leaked into the diagnostic (`q: e\x1c f`). GNU anchor: subst.c:8216 parameter_brace_expand_error expands the message word (expand_string, quote removal included) and reports the plain text via report_error("%s: %s"). The message is display text, not a value, so both construction points now pass the expanded word through the sanctioned visible-text face (locale::decode_to_visible_text): the pre-scan arm in parameter_errors.rs and the double-quoted/prompt-pass arm in embedded_parameters.rs. Value positions (e.g. `:-`) are untouched - the IFS_GLUE carrier still survives there (guard nail value_context_glue_preserved, rubash#212). Regression nails: tests/issue3260_colon_question_diag_carrier.rs, 11 cells (dq/sq/tab/non-colon/nested/pipeline/heredoc/unquoted control/empty default/value-in-quotes/value-context guard), all expectations verified against GNU bash 5.3.20 script-file runs. 本 PR 删除了什么:无。纯加法修法:两处构造点各包一层 decode_to_visible_text;无删除、无重命名、无公开面变化。 UNVERIFIED-BY-CAPTAIN
Member
Author
|
【WIN-AGENT-AUDIT】 PR #3462 第1轮 — 建议:PASS 机制核查:
腿(逐项):
F 点:无。 续作记录:未动代码。 未跑/VOID 的腿:无。 |
caomengxuan666
marked this pull request as ready for review
November 15, 2026 02:06
This was referenced Nov 15, 2026
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.
根因
${q:?...}诊断消息词经expand_parameter_word后带 IFS_GLUE(\x1c)载体直接印出,未过法定解码面;两处:?诊断构造点(pre-scan 臂parameter_errors.rs与双引号/prompt-pass 臂embedded_parameters.rs)现统一过locale::decode_to_visible_text。GNU 锚点
subst.c:8216
parameter_brace_expand_error:expand_string展开消息词(含 quote removal),report_error("%s: %s")报纯文本。消息是 display text,不是 value;值位(如:-)不动,IFS_GLUE 载体仍保留(guard 钉value_context_glue_preserved,rubash#212)。验证(Simular box,cargo 1.99.1,-j 1)
$"e f"GNU 原样输出$"e f",base 已对,非修法面)RUSTFLAGS="-D warnings" cargo check --locked --lib --bins:0 errorcargo fmt --check/check-marker-literals.py/check-utf8-boundary-hygiene.sh均 rc=0expand_parameter_word仅两处喂:?诊断,余下调用点均为值位/非诊断面本 PR 删除了什么
无。纯加法修法:两处构造点各包一层
decode_to_visible_text;无删除、无重命名、无公开面变化。UNVERIFIED-BY-CAPTAIN