From owner-svn-src-head@FreeBSD.ORG Wed Jan 20 08:43:34 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7F1D106568D; Wed, 20 Jan 2010 08:43:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 80DAD8FC24; Wed, 20 Jan 2010 08:43:34 +0000 (UTC) Received: from besplex.bde.org (c220-239-227-214.carlnfd1.nsw.optusnet.com.au [220.239.227.214]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o0K8hTmQ021109 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Jan 2010 19:43:32 +1100 Date: Wed, 20 Jan 2010 19:43:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov In-Reply-To: <20100120070843.GA45937@nagual.pp.ru> Message-ID: <20100120191752.Q2120@besplex.bde.org> References: <201001181344.o0IDiiEL079037@svn.freebsd.org> <20100120012639.B67517@delplex.bde.org> <20100120070843.GA45937@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 08:43:35 -0000 On Wed, 20 Jan 2010, Andrey Chernov wrote: > On Wed, Jan 20, 2010 at 01:42:08AM +1100, Bruce Evans wrote: >> The comment was correct. It says that POSIX requires strcoll() for >> alphasort(), not for opendir(). Since opendir() is not alphasort(), >> and it wants plain ASCII sorting to support union file systems, it >> intentionally doesn't use either alphasort() or strcoll(). > > Yes, the comment _alone_ was correct, but its place - isn't. Along with > function name containing _alphasort part it makes impression that > opendir() uses this type of sort too. 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. > BTW, we already have the same correct comment but in the proper place in > the scandir.c That one is quite different. It describes why alphasort() (now) uses strcoll(). It is because POSIX says so. This comment is relatively useless. It obviously uses strcoll(), and it is a POSIX interface so this would be surprising only if it conflicted with POSIX. The comment is there mainly for historical reasons, and history belongs in the man 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(). >> Was correct, but it could have been clearer by saying ", so opendir() >> uses this comparison function instead of alphasort()". > > "So", what? The two mentioned things are unrelated and can't be > concatenated by "so". They are related. >> I forget what the old name was. Having alphasort in the name here was >> wrong 3 layers deep, since this is not alphasort(), and alphasort() is not >> an alpha sorting function -- it is a lexicographically-on-the-whole- >> character-set comparison function. > > Yes. > >> Correct modulo the name. > > What name you suggest, opendir_compar()? OK. >> New bug in a comment in scandir(): now has an extra blank line, due to >> partial removal. > > Ok, will remove it a bit later. 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. Bruce