From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Iu2uy-0006qn-Ty for garchives@archives.gentoo.org; Mon, 19 Nov 2007 09:27:49 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.2/8.14.0) with SMTP id lAJ9QrSf019850; Mon, 19 Nov 2007 09:26:53 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by robin.gentoo.org (8.14.2/8.14.0) with ESMTP id lAJ9Ouuw017338 for ; Mon, 19 Nov 2007 09:24:56 GMT Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 073486562F for ; Mon, 19 Nov 2007 09:24:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -0.033 X-Spam-Level: X-Spam-Status: No, score=-0.033 required=5.5 tests=[AWL=0.499, BAYES_00=-2.599, RCVD_NUMERIC_HELO=2.067] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xj7lXmd14RXL for ; Mon, 19 Nov 2007 09:24:49 +0000 (UTC) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 4C27B65483 for ; Mon, 19 Nov 2007 09:24:48 +0000 (UTC) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Iu2rw-0001Ek-IN for gentoo-dev@gentoo.org; Mon, 19 Nov 2007 09:24:40 +0000 Received: from 91.84.64.164 ([91.84.64.164]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Nov 2007 09:24:40 +0000 Received: from slong by 91.84.64.164 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Nov 2007 09:24:40 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-dev@lists.gentoo.org From: Steve Long Subject: [gentoo-dev] Re: Re: Re: [gentoo-commits] gentoo-x86 commit in dev-libs/libevent: ChangeLog libevent-1.3e.ebuild Date: Mon, 19 Nov 2007 09:28:59 +0000 Message-ID: References: <20071112082528.GD19458@supernova> <4738E093.7040009@gentoo.org> <473A4272.1070108@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 91.84.64.164 User-Agent: KNode/0.10.4 Sender: news X-Archives-Salt: 40770629-7093-4700-9ecf-5b0e5eeacd31 X-Archives-Hash: 131ba299bab1fa50b433be8ed110bedc Steve Long wrote: > No, that's about the size of it-- if you you'd like to tie it to ASCII, > irrespective of locale, that's fair enough. > I had a feeling this statement was incorrect (what zlin said about a-z) so I asked dalias in #bash who is knowledgeable about locale stuff: dalias; have a q re: l10n. if we want to restrict allowed chars to ASCII (for config) without affecting user's LC_CTYPE, what's the best way? igli, where do you want to restrict chars? example i've seen is in checking a var checking a var to make sure it's all ascii? yeah [A-Za-z] isn't locale-safe is it? match it to a regex hmm ok it's safe if LC_COLLATE=C ah thanks :D alternatively the most safe way is just to write all chars explicitly [ABCDEF...xyz] hehe ok nice one, i'll pass it on. anyway posix guarantees that the collation order in C locale is ascii order even if the host's character encoding is something idiotic like ebcdic The odd bit (for me) is that [A-Za-z] is affected by LC_COLLATE not LC_CTYPE, which makes sense if you think of it as a comparison. [[:class:]] is ofc CTYPE. So setting LC_COLLATE=C would appear to make sense, as long as you are never dealing with user filenames, but only the portage tree (which seems a bit yuck). A better general implementation might be a function that checks against the explicit list, since that would have no implications for file handling: isAlphaASCII() { for i; do [[ $i = *[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzxyz]* ]] \ && return 1 done return 0 } I /guess/ in sh the test line would be: case "$i" in *[!ABC..xyz]* ) return 1;; esac -- gentoo-dev@gentoo.org mailing list