Skip to content

[uniq] -w -1 silently ignored (collides with the no--w sentinel); GNU errors #1341

Closed

Description

@caomengxuan666

Summary

uniq -w -1 exits 0 doing nothing useful; GNU errors.

Evidence (harness vs GNU, two runs)

  • printf 'ab\nac\n' | uniq -w -1
    • GNU: uniq: invalid width value: '-1' family diagnostic, rc1.
    • WinuxCmd: rc0, prints input unchanged — the -1 value collides with the "no -w given" sentinel (-1) in uniq.cpp, so the option is silently dropped.

Regression seed

  • The case → expect rc1 + diagnostic. (uniq -w 0 and positive widths unchanged.)

Found by the full-audit.

Activity

  1. added
    bug
    compat-gap
    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

bugcompat-gap

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions