Skip to content

[linux] glob/extglob results sort bytewise, GNU sorts by locale collation (strcoll): dotfile interleave differs (glob 40 / extglob 16 diff lines) #235

Closed

Description

@caomengxuan666

Linux build (wt4/linuxrun), true-baseline harness (en_US.UTF-8 generated), GNU 5.3.0 baseline. 100% of the remaining glob-suite (40) and extglob-suite (16) stdout diffs are ORDERING, not membership.

Repro (glob.tests/extglob.tests through true-baseline; minimal shape):

touch .a .aa .b .bb a aa b bb
echo *          # glob

Expected (GNU, en_US.UTF-8): .a a .aa aa .b b .bb bb - collation ignores punctuation at the primary level, interleaving dotfiles among plain names.
Actual (rubash): .a .aa .b .bb a aa b bb - plain byte sort groups dotfiles first.

extglob examples: GNU a .b vs rubash .b a; GNU .a bar .foo vs rubash .a .foo bar.

Owning anchors: bash sorts glob results with strcoll when LC_COLLATE is not C (lib/glob/strmatch.c / glob_sort_flags callers in glob.c glob_dir_to_array using strcoll; extglob path likewise). Under LANG=C both shells agree, so this is observable specifically in locale-enabled environments (hence platform:linux label for the observation; the fix is engine-wide: sort with strcoll per current LC_COLLATE).

Artifacts: target/issue-suites/results/true-baseline/glob/{gnu.out,rb.out}, extglob/{gnu.out,rb.out}; ledger glob 40 env=40 / extglob 16 env=16 (classifier bucket irrelevant - lines are pure ordering).

Activity

  1. added
    bug
    gnu-baseline
    platform:linux
    on Sep 27, 2026
  2. caomengxuan666 commented on Sep 27, 2026

    @caomengxuan666
    MemberAuthor

    已修复并合入 master(commit b2e41b4e,lane wt4/linuxfix;GNU 引用与验证见提交信息:Linux 真机 WSL 双壳验证、24 套件平价 17→19)。感谢报告!

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

    buggnu-baselineplatform:linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions