GNU bug report logs - #9780
sort -u throws out non-duplicates

Previous Next

Package: coreutils;

Reported by: Bernhard Rosenkraenzer <bero <at> bero.eu>

Date: Tue, 18 Oct 2011 01:04:02 UTC

Severity: normal

Tags: moreinfo

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jim Meyering <jim <at> meyering.net>
Cc: 9780 <at> debbugs.gnu.org, Rasmus Borup Hansen <rbh <at> intomics.com>
Subject: bug#9780: sort -u throws out non-duplicates
Date: Fri, 17 Aug 2012 12:41:41 -0700
On 08/17/2012 12:36 PM, Jim Meyering wrote:
> The first time the safe_text buffer is allocated
> it will have to be disjoint from the line.text buffer
> and from the buffer into which we're about to fread.
> Thereafter, regardless of reallocation, overlap should
> always be false.

I haven't thought it through entirely, but I was
worried about the case where there is a saved line
but no saved_text, the buffer is reallocated, and
then we test for overlap.  If the reallocated buffer
does not overlap the original buffer, the test for
overlap will fail even though the saved line needs
to be copied into a new saved_text buffer.

I'll stare at the code some more....




This bug report was last modified 12 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.