Skip to content

[bug] Compound assignment: glued quoted array expansions (pre"${arr[@]}"post) collapse to one element #2417

Closed

Description

@caomengxuan666

Found en route to #2387 (PR #2415): in compound assignment, glued forms (pre"${arr[@]}"post) and (pre"${!foo_@}"post) collapse to ONE element in rubash; GNU bash 5.3.20 produces one element per expansion member with the literal text glued to the first/last (3 elements for a 3-element array). Plain (unglued) quoted forms are correct after #2387; the glued token route bypasses the fan-out arms in the compound-assignment dispatcher (src/executor/assignment_expansion.rs).

Fix destination: compound-assignment expansion — the fan-out must apply per-member even when the quoted expansion is glued to literal text on either side, matching subst.c's word-expansion result list handling.

Regression seed: a=(${arr[@]} baseline shapes with arr=(x y z): (pre"${arr[@]}"post) should be (prex y zpost).

Activity

  1. added
    bug
    area:expansion
    on Nov 1, 2026
  2. added a commit that references this issue on Nov 1, 2026
  3. caomengxuan666 commented on Nov 1, 2026

    @caomengxuan666
    MemberAuthor

    PR #2451 (merged, master d44dce1). Glued quoted spans (pre"${arr[@]}"post) now fan out per member at the single-string funnel, per arrayfunc.c:557 per-word expansion. My verification: issue2417 pins 5/5 green (scrubbed-fd harness). Documented leftovers (subscript-prefixed glued elements, glued slice/operator spans) are recorded in the PR report for a follow-up wave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:expansionbug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions