Skip to content

nl: negative values for -v / -i are rejected #15999

Closed

Description

@sylvestre
$ printf 'a\nb\n' | nl -v -1

GNU:

    -1	a
     0	b

uutils:

error: unexpected argument '-1' found
  tip: to pass '-1' as a value, use '-- -1'

Same for nl -i -1 and nl --line-increment -1. Clap needs allow_negative_numbers (or allow_hyphen_values) on these args.

Reported in #15254 (found by a differential fuzzer; reproduced against GNU coreutils 9.12).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions