Skip to content

[bug] compgen -W wordlist splits only on spaces, ignoring IFS (newlines and IFS chars do not split) #1797

Closed

Description

@caomengxuan666

形状

compgen -W <wordlist> 的词表切分:GNU 按 IFS 空白(含换行、tab)切分,且临时 IFS=: 赋值时按 : 切分;rubash 只按空格切,换行与 IFS 字符都不切,导致整块返回或前缀匹配落空 rc=1。

复现(master 202de47,GNU oracle = 自编 bash 5.3.20,两轮同集)

compgen -W $'a\nb c' a; echo rc:$?
# GNU: a / rc:0 ;rubash: a\nb(整块)/ rc:0

compgen -W $'a\nb c' b; echo rc:$?
# GNU: b / rc:0 ;rubash: rc:1

compgen -W $'ab\ncd' c; echo rc:$?
# GNU: cd / rc:0 ;rubash: rc:1

IFS=: compgen -W 'a:b:c' a; echo rc:$?
# GNU: a / rc:0 ;rubash: a:b:c(整串)/ rc:0

IFS=: compgen -W 'a:b:c' b; echo rc:$?
# GNU: b / rc:0 ;rubash: rc:1

出处

diff-hunt r9 裁定(cases cw16–cw18、cw20、cw21),两轮同集:~/workspace/rubash-hunt-runs/2026-10-26-r9/results-r8-pass1.json。旧案 #1087 处理过 -W 引号处理,本条是切分字符集(IFS)残差。

归宿

compgen 族修复簇(r9 同批)。在飞线收完后开簇。修复须带回归钉(测试名含本 issue 号、断言 GNU 期望)。

Regression seed: cw16–cw18、cw20、cw21。

Activity

  1. added
    bug
    gnu-baseline
    P2-medium
    area:builtins
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2-mediumarea:builtinsbuggnu-baseline

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions