Skip to content

comsub body with reserved-word case patterns swallows the rest of the line #405

Closed

Description

@caomengxuan666

Summary

A command-substitution body whose case patterns are reserved words (else|done|time|esac) makes the comsub swallow the rest of the line: the follow-up printf > file never runs (file absent) while rc stays 0. GNU runs the line and writes v=<> status:0.

Reproducer (probe wt37-374 K003)

v=$(case k in else|done|time|esac) for f in 1 2 3; do printf x; done esac); printf 'v=<%s> status:%s\n' "$v" "$?" > OUT

GNU: OUT contains v=<> status:0, rc 0. rubash CLI: OUT absent, rc 0.

Note: the wt33 first-pass conversion of this test was based on a corrupted probe that claimed IDENT; the mechanically re-extracted probe shows the divergence.

GNU owner

parse.y parse_comsub / subst.c command_substitute body end detection.

Artifacts

target/issue-suites/results/wt37-374/run/K003.*

Activity

  1. added
    bug
    on Oct 2, 2026
  2. added 2 commits that reference this issue on Oct 2, 2026
  3. caomengxuan666 commented on Oct 3, 2026

    @caomengxuan666
    MemberAuthor

    Landed on master through the wt38 pool recovery waves (CI green); see the issueNNN regression suite and lane matrices on the ticket.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions