Date: Thu, 6 Jun 2002 19:24:02 +1000 From: "Tim J. Robbins" <tjr@FreeBSD.org> To: "Andrey A. Chernov" <ache@nagual.pp.ru> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/uniq uniq.c Message-ID: <20020606192402.A45186@treetop.robbins.dropbear.id.au> In-Reply-To: <20020606083246.GA85860@nagual.pp.ru>; from ache@nagual.pp.ru on Thu, Jun 06, 2002 at 12:32:47PM %2B0400 References: <200206060313.g563DAi26751@freefall.freebsd.org> <20020606031545.GA83612@nagual.pp.ru> <20020606161843.A44561@treetop.robbins.dropbear.id.au> <20020606083246.GA85860@nagual.pp.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 06, 2002 at 12:32:47PM +0400, Andrey A. Chernov wrote: > On Thu, Jun 06, 2002 at 16:18:43 +1000, Tim J. Robbins wrote: > > On Thu, Jun 06, 2002 at 07:15:45AM +0400, Andrey A. Chernov wrote: > > > > > On Wed, Jun 05, 2002 at 20:13:10 -0700, Tim J. Robbins wrote: > > > > tjr 2002/06/05 20:13:10 PDT > > > > > > > > Modified files: > > > > usr.bin/uniq uniq.c > > > > Log: > > > > Compare lines with strcmp(), not strcoll(). We are interested only in > > > > equality, not ordering. > > > > > > > > > Please back it out. It break equality. Think about ss. > > > > Supply a test case and perhaps I shall. > > I mention it already above, ss (two chars) == <ss> (single char) in some > locales. uniq is defined in terms of string equality, not string collatng order. It doesn't matter how the input is split into collating elements or their weights, what matters is that the lines have the same bit patterns. The GNU implementation uses memcmp() to compare lines. Solaris appears to use strcmp() (objdump -T on /bin/uniq shows no reference to strcoll or strxfrm). SUSv3 does not mention LC_COLLATE as affecting uniq. NetBSD uses strcmp(). AT&T AST uses memcmp(). Sigh. Tim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020606192402.A45186>