Repository navigation
fix(redir): redirection_error diagnostics honor gnu_errfmt (Refs #1038, #4203) - #4287
Conversation
Round 1 review — needs rework (one item)Head CI — clean modulo standing reds
The fix, verified
§3 — missed: coproc redirect-word expansion errors still ungated
Oracle (gnu_errfmt on): Note (separate, pre-existing, not blocking): the coproc empty-expansion arm also has What is correctly left aloneThe remaining Rework list
Refs #4287 (round 1 re-review; not Fixes). Dossier: |
Round 1 addendum — port-side runtime verification (devin-mac, this head)The round-1 review's port-side evidence was CI + oracle only (the lane tree was held by a safety check). The tree has since been approved and the probes re-run against a real build of this head (
Net effect on the rework list: unchanged in substance (the two coproc.rs sites + one pin), with the q4 face now runtime-confirmed and the q5 prefix explicitly out of scope. |
e9126ad to
39cdef9
Compare
|
Round-1 rework applied (head rebased on master ef4ea1b): coproc.rs:1886 and :2007 now use error_prefix(); +1 pin coproc_nounset_redirect_word_gates_line_segment (oracle 5.3.20: |
Refs #1038, #4203
What
GNU
redirection_error()(redir.c:135-228) reports every failure throughinternal_error()->error_prolog(1)(error.c:74-86), which honorsshopt -s gnu_errfmt(file:N:instead offile: line N:). Rubash's redirect-failure producers useddiagnostic_prefix()(always: line N:), so undergnu_errfmtthe failing-entry lookup inwrite_redirect_diagnostic_routedfailed to match the prefix, re-applied the failing redirect and printed a second diagnostic:echo hi > /nonexistent/fprinted two lines.Fix
Switch the redirection_error producers (simple-builtin, read, trap/stack builtins, compound bad-fd dup, coproc, comsub, pipeline, fd-var assignment) to
error_prefix()/compound_redirect_error_prefix(). Builtin write-error diagnostics keepdiagnostic_prefix()(builtins/common.c:83-110 never gates on gnu_errfmt).Verification
issue1038_gnu_errfmt_prefix9/9 on Windows and WSL Linux; 17 script-file probes byte-identical to GNU Bash 5.3.20.issue1038_gnu_errfmt_prefixfromscripts/ci-pin-exclusions.txt.What this PR deletes
One line from
scripts/ci-pin-exclusions.txt; no code deleted (prefix call swaps only).