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:19:35 -0700
On 08/16/2012 02:03 PM, Jim Meyering wrote:
> * src/sort.c (saved_line): New static/global, renamed and moved from...
> (write_unique): ...here.

I see a couple of problems with this patch.  Pedantically,
the behavior of 'overlap' is undefined on hosts that
use a segmented architecture, because '<=' is not reliable
on pointers into different buffers.  (I have the vague recollection
that some compilers even rely on this to generate faster code
on flat architectures....)  More importantly, suppose the
buffer is reallocated (because it grows)?  Won't 'overlap'
do the wrong thing after that?  And it'd be nice if we didn't
have to worry about making a copy of that line.

I'll see if I can come up with something that addresses these
objectinos.




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.