From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23212 invoked from network); 2 May 2001 15:28:57 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 May 2001 15:28:57 -0000 Received: (qmail 18509 invoked by alias); 2 May 2001 15:28:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14204 Received: (qmail 18479 invoked from network); 2 May 2001 15:28:50 -0000 Message-ID: To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: order of processing in brace expansion In-Reply-To: Your message of "Wed, 02 May 2001 14:59:59 -0000." <1010502150000.ZM14338@candle.brasslantern.com> Date: Wed, 02 May 2001 16:28:21 +0100 From: Peter Stephenson Bart wrote: > > That is, in all versions of zsh so far, using a parameter expansion is a > > way to quote commas against brace expansion while still getting filename > > generation after the expansion. > > I was wondering whether there might be some sort of compromise, such as > only tokenizing commas when BRACE_CCL is set. I don't really like filling the code full of this sort of dependency, unless it can be proven that someone, somewhere was using this particular hack which none of us here even suspected existed until a few days ago. But it has just occurred to me that actually the fix results in some other illogical results. % foo='{a,b}' % print $~foo {a,b} % print {$~foo} {a b} This is rather hairy. The obvious fix is to tokenize braces, too. This seems to do the trick, but the change of behaviour is now much more obvious. We probably ought to make it either all or nothing. Bash doesn't expand braces that result from parameters (probably due to the ordering of expansions). Any suggestions? It doesn't seem worth an option. Index: Src/glob.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/glob.c,v retrieving revision 1.16 diff -u -r1.16 glob.c --- Src/glob.c 2001/05/02 09:53:32 1.16 +++ Src/glob.c 2001/05/02 15:22:28 @@ -2374,6 +2374,8 @@ case '?': case '=': case ',': + case '{': + case '}': for (t = ztokens; *t; t++) if (*t == *s) { if (bslash) -- Peter Stephenson Software Engineer CSR Ltd., Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************