freebsd-src/usr.bin/uniq
Dag-Erling Smørgrav c3f8900e69 uniq: Fix off-by-one bug in -cD case.
When printing only duplicated lines, the first line of each set is not
printed until we encounter the second.  When that happens, we need to
increment the repetition count between printing the first and the
second line, so that if we are also printing counts, we don't print the
same (pre-increment) count twice.

MFC after:	1 week
PR:		275764
Reported by:	Yu-Sheng Ma <s110062131@m110.nthu.edu.tw>
Submitted by:	Daniel Tameling <tamelingdaniel@gmail.com> (original patch)
Sponsored by:	Klara, Inc.
Reviewed by:	tamelingdaniel_gmail.com, asomers, emaste
Differential Revision:	https://reviews.freebsd.org/D48000
2024-12-09 20:44:46 +01:00
..
tests uniq: Fix off-by-one bug in -cD case. 2024-12-09 20:44:46 +01:00
Makefile
Makefile.depend
uniq.1 uniq: Correctly document the -D option. 2024-12-09 20:44:34 +01:00
uniq.c uniq: Fix off-by-one bug in -cD case. 2024-12-09 20:44:46 +01:00