From owner-svn-src-head@FreeBSD.ORG Thu Jan 7 05:04:15 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 5588A1065693; Thu, 7 Jan 2010 05:04:15 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 888B48FC1A; Thu, 7 Jan 2010 05:04:14 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id o0754CGd085737; Thu, 7 Jan 2010 08:04:12 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1262840652; bh=l3kyg3rPFbynmV0cAUesUeu3I4E8lSugddtOu/ECFAY=; l=1078; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=fyjlfFU9Cpor/queBDrjGZ9Nt6qFpZ0iPaJfUW4Uqi+vrojgiDn9pb8SPqc+xULZU RqriVa7rk90fXekuNf1BS8+LI0bM+hU08yoQ1BN9QlB2mSpI9mnk3eUaU5WrlaUawy rX/5LEwH0bCL3cmwDUGdkCu4nzySHmsWBRNQRtZ4= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o0754Bx7085736; Thu, 7 Jan 2010 08:04:11 +0300 (MSK) (envelope-from ache) Date: Thu, 7 Jan 2010 08:04:10 +0300 From: Andrey Chernov To: Konstantin Belousov Message-ID: <20100107050409.GA85573@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Konstantin Belousov , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201001052020.o05KKVEp002337@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001052020.o05KKVEp002337@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r201604 - 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: Thu, 07 Jan 2010 05:04:15 -0000 On Tue, Jan 05, 2010 at 08:20:31PM +0000, Konstantin Belousov wrote: > * Alphabetic order comparison routine for those who want it. > + * > + * XXXKIB POSIX 2008 requires the alphasort() to use strcoll(). Keep > + * strcmp() for now, since environment locale settings could have no > + * relevance for the byte sequence of the file name. Moreover, it > + * might be even invalid sequence in current locale, and then > + * behaviour of alphasort would be undefined. > */ This is wrong turn. Exact the same can be said about text files: "environment locale settings could have no relevance for the byte sequence of the text. Moreover, it might be even invalid sequence in current locale, and then behaviour of sort would be undefined". Despite of this, we use localized sort in the system. You made result of something like 'ls | sort' and alphasort() differs. Please use strcoll() as POSIX said. It is user responsibility to set correct locale for non-suid programs, and for suid ones locale can't be set by user. -- http://ache.pp.ru/