HomeFreeBSD

uniq: Fix interactive use.

Description

uniq: Fix interactive use.

Output a line as soon as it is possible to determine that it will have
to be output. For the basic case, this means output each line as it is
read unless it is identical to the previous one. For the -d case, it
means output the first instance as soon as the second is read, unless
the -c option was also given. The -D and -u cases were already fine.

Add test cases for interactive use with no options and with -d.

Explicitly ignore -d when -D is also specified.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: rew, kevans
Differential Revision: https://reviews.freebsd.org/D43382

Details

Provenance
desAuthored on Jan 12 2024, 3:40 PM
Reviewer
rew
Differential Revision
D43382: uniq: Fix interactive use.
Parents
rGe762fd81e253: uniq: Replace NetBSD's unit tests with our own.
Branches
Unknown
Tags
Unknown