]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
uniq: Fix interactive use.
authorDag-Erling Smørgrav <des@FreeBSD.org>
Fri, 12 Jan 2024 15:40:33 +0000 (16:40 +0100)
committerDag-Erling Smørgrav <des@FreeBSD.org>
Fri, 12 Jan 2024 15:43:55 +0000 (16:43 +0100)
commit11715600e626cf6cc4b4f564af97f6ae1e5fb0be
tree146bf74cdf51ce742620fdc67f8d80cc3f07efa9
parente762fd81e253d4ae9b9f7d2e65cf448633bbe527
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
usr.bin/uniq/tests/uniq_test.sh
usr.bin/uniq/uniq.1
usr.bin/uniq/uniq.c