Skip to content

[bug] Runtime shopt -s extglob does not enable later case extglob arms #1093

Closed

Description

@caomengxuan666

[bug] Runtime shopt -s extglob (via eval/function) doesn't enable later case extglob arms — parse-time gate

c() { if eval "$2"; then echo "T: $1"; else echo "F: $1"; fi; }
c 'x' 'shopt -s extglob; [[ aaab == +(a)b ]]'
case aaab in +(a)b) echo MATCH;; *) echo NOMATCH;; esac
# GNU bash 5.3:  T: x / MATCH
# niu:           T: x / syntax error near unexpected token `(', rc=2

Top-level shopt -s extglob before the case works in both; eval-internal @(...)/!(...) in [[ ]] also errors under niu while bash accepts. Possibly related to closed #302 (different symptom — function headers, not case arms).

Env: niubash 1.4.4 / rubash engine (master ~2026-10), GNU bash 5.3.20 aarch64-linux-android as oracle.

Activity

  1. added
    bug
    gnu-baseline
    area:parser
    P2-medium
    on Oct 22, 2026
  2. caomengxuan666 commented on Oct 23, 2026

    @caomengxuan666
    MemberAuthor

    Fixed by #1181 (2026-10-22/23 bulk GNU-parity wave): landed as a dedicated commit referencing this issue, covered by the audit differential suite (tests/fixtures/audit/), and re-verified byte-for-byte against a GNU bash 5.3.20 oracle; master CI (ff1a555) runs the suite green.

    Closing now to restore the linkage: GitHub's closing-reference parser only honored the first entry of #1181's long Fixes list, so this stayed open after the fix landed. If anything still reproduces on current master, reopen with a transcript and it returns to the fix queue.

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

    P2-mediumarea:parserbuggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions