From owner-svn-src-all@FreeBSD.ORG Wed Jan 20 10:33:13 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCFF91065693; Wed, 20 Jan 2010 10:33:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 5529E8FC08; Wed, 20 Jan 2010 10:33:12 +0000 (UTC) Received: from besplex.bde.org (c220-239-227-214.carlnfd1.nsw.optusnet.com.au [220.239.227.214]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o0KAX8im020073 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Jan 2010 21:33:10 +1100 Date: Wed, 20 Jan 2010 21:33:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov In-Reply-To: <20100120094627.GA53020@nagual.pp.ru> Message-ID: <20100120211722.S2451@besplex.bde.org> References: <201001181344.o0IDiiEL079037@svn.freebsd.org> <20100120012639.B67517@delplex.bde.org> <20100120070843.GA45937@nagual.pp.ru> <20100120191752.Q2120@besplex.bde.org> <20100120094627.GA53020@nagual.pp.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r202572 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 10:33:13 -0000 On Wed, 20 Jan 2010, Andrey Chernov wrote: > On Wed, Jan 20, 2010 at 07:43:29PM +1100, Bruce Evans wrote: >> No, it is a comment about opendir()'s comparison function. It has nothing >> to do with scandir(), and the only thing that it has to do with alphasort() >> is that it must be different for the reasons described. > > Then the comment was plain wrong (not misplaced), so removing it becomes > right again because the comment states: "opendir()'s comparison function" > according to POSIX 2008 and XSI 7 should use strcoll(). No. It never mentioned opendir() or even scandir(). It only mentioned the relevant things. Here it is: 1.25 (delphij 16-Apr-08): /* 1.27 (kib 05-Jan-10): * POSIX 2008 and XSI 7 require alphasort() to call strcoll() for 1.27 (kib 05-Jan-10): * directory entries ordering. Use local copy that uses strcmp(). 1.27 (kib 05-Jan-10): */ > But there is > nothing said about opendir() & strcoll() relation in the mentioned > standards. The only word I found is that opendir() returns "ordered" > sequence, but nowhere mentioned ordered by what criteria, so perhaps they > mean "stable": As I said before, sorting in opendir() has nothing to do with POSIX! It is an implementation detail for union file systems/mounts. >> page more than here. BTW, I don't remember any man page updates for >> this. The man page still only says that alphasort() can be used to >> give alphabetical sorting in scandir(). > > Alphabetically already means sorted according to collate, otherwhise it is > called binary. Perhaps manpage should refer strcoll() directly. Yes it should, like POSIX does. It should also give the FreeBSD extension of POSIX. POSIX says: "If the strcoll() function fails, then the return value of alphasort() is unspecified.", but this makes alphasort() unusable since a qsort() comparison function must return a specified value. > >> I can't see this now (some illusion from my mailer or $TERMCAP >> misformatting the patch?), but now I see an extra "the" in it: >> >> "requires the alphasort() to use strcoll()" >> >> should be either >> >> "requires that alphasort() uses strcoll()" >> >> (preferred) or >> >> "requires alphasort() to use strcoll()" >> >> (probably intended, but not too passive). I thought that you removed >> this line completely. The previous line is even less useful. > > I don't add extra "the" there) What do you want, clarify please: > 1) Remove whole comment. > 2) Remove only first line and correct second to "that". > 3) Just correct second to "that". Correct the second line to "that ... uses". Bruce