Page MenuHomeFreeBSD

uniq: Fix off-by-one bug in -cD case.
ClosedPublic

Authored by des on Dec 9 2024, 3:01 PM.
Tags
None
Referenced Files
F133947793: D48000.id147745.diff
Wed, Oct 29, 1:06 PM
F133946698: D48000.id147732.diff
Wed, Oct 29, 12:57 PM
F133946615: D48000.id147745.diff
Wed, Oct 29, 12:56 PM
F133946482: D48000.id147738.diff
Wed, Oct 29, 12:56 PM
F133946418: D48000.id.diff
Wed, Oct 29, 12:55 PM
F133946416: D48000.id147732.diff
Wed, Oct 29, 12:55 PM
F133946247: D48000.diff
Wed, Oct 29, 12:54 PM
Unknown Object (File)
Wed, Oct 22, 6:34 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61051
Build 57935: arc lint + arc unit

Event Timeline

des requested review of this revision.Dec 9 2024, 3:01 PM
emaste requested changes to this revision.Dec 9 2024, 3:46 PM
emaste added a subscriber: emaste.

We don't increment repeats with only -c now.

This revision now requires changes to proceed.Dec 9 2024, 3:46 PM

Please double check the PR number in your commit message.

Simpler patch that doesn't break the cflag && !dflag && !Dflag case

This revision is now accepted and ready to land.Dec 9 2024, 6:45 PM
This revision was automatically updated to reflect the committed changes.