Skip to content

[gap] factor: invalid input exits 0 instead of 1 #1001

Closed

Description

@caomengxuan666

Summary

factor exits 0 when given a non-numeric or non-integer argument; GNU exits 1. Diagnostic wording also differs ('not a valid integer' vs 'not a valid positive integer').

Repro

winuxcmd.exe factor abc
winuxcmd.exe factor 2.5
winuxcmd.exe factor 0x10

GNU coreutils 8.32 (D:/Git/usr/bin/factor.exe)

factor: 'abc' is not a valid positive integer   (exit 1)
factor: '2.5' is not a valid positive integer   (exit 1)
factor: '0x10' is not a valid positive integer  (exit 1)

WinuxCmd 1.0.6 (WINUX_LANG=en)

factor: 'abc' is not a valid integer   (exit 0)
factor: '2.5' is not a valid integer   (exit 0)
factor: '0x10' is not a valid integer  (exit 0)

Activity

  1. added
    bug
    compat-gap
    on Sep 14, 2026
  2. caomengxuan666 commented on Sep 14, 2026

    @caomengxuan666
    MemberAuthor

    Fixed in release/v1.0.6 — verified against GNU coreutils 9.4 (WSL) with byte-identical or semantically identical output. See the GNU-parity commits on this branch.

  3. added a commit that references this issue on Sep 14, 2026
    5b0d62b
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

    bugcompat-gap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions