From owner-cvs-all Thu Jun 6 2:26:48 2002 Delivered-To: cvs-all@freebsd.org Received: from treetop.robbins.dropbear.id.au (254.a.005.mel.iprimus.net.au [210.50.40.254]) by hub.freebsd.org (Postfix) with ESMTP id D21AD37B405; Thu, 6 Jun 2002 02:26:33 -0700 (PDT) Received: from treetop.robbins.dropbear.id.au (localhost [127.0.0.1]) by treetop.robbins.dropbear.id.au (8.12.2/8.12.2) with ESMTP id g569OBBF045207; Thu, 6 Jun 2002 19:24:13 +1000 (EST) (envelope-from tim@treetop.robbins.dropbear.id.au) Received: (from tim@localhost) by treetop.robbins.dropbear.id.au (8.12.2/8.12.2/Submit) id g569O6b4045206; Thu, 6 Jun 2002 19:24:06 +1000 (EST) Date: Thu, 6 Jun 2002 19:24:02 +1000 From: "Tim J. Robbins" To: "Andrey A. Chernov" 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> References: <200206060313.g563DAi26751@freefall.freebsd.org> <20020606031545.GA83612@nagual.pp.ru> <20020606161843.A44561@treetop.robbins.dropbear.id.au> <20020606083246.GA85860@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020606083246.GA85860@nagual.pp.ru>; from ache@nagual.pp.ru on Thu, Jun 06, 2002 at 12:32:47PM +0400 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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) == (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