From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5688 invoked from network); 7 Nov 2002 16:44:25 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 7 Nov 2002 16:44:25 -0000 Received: (qmail 10640 invoked by alias); 7 Nov 2002 16:44:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17913 Received: (qmail 10627 invoked from network); 7 Nov 2002 16:44:09 -0000 X-VirusChecked: Checked X-Env-Sender: kiddleo@logica.com X-Msg-Ref: server-16.tower-4.messagelabs.com!1036687416!42186 cc: Zsh Workers In-reply-to: <20021008045836.GA28326@aeolian.emufarm.org> From: Oliver Kiddle References: <20021008045836.GA28326@aeolian.emufarm.org> To: Danek Duvall Subject: PATCH: Re: completion in braces MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22757.1036687314.1@logica.com> Date: Thu, 07 Nov 2002 16:43:36 +0000 Sender: kiddleo@logica.com Message-Id: On 7 Oct, Danek Duvall wrote: > Completion inside braces of filenames containing commas leaves the > filenames improperly escaped: > > % ls > a,a a,b a,c b,a b,b b,c > % ls -l $PWD/{ Hit tab => > % ls -l $PWD/{a,a Type comma/tab/tab => Following patch seems to fix this, at least for the new completion system. But I'm no expert on what's going on in the completion code so I'd be happier if someone else such as Sven could check this and perhaps get it to work for the compctl system too. Oliver Index: Src/Zle/computil.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v retrieving revision 1.83 diff -u -r1.83 computil.c --- Src/Zle/computil.c 27 Aug 2002 21:10:34 -0000 1.83 +++ Src/Zle/computil.c 7 Nov 2002 16:29:53 -0000 @@ -3345,6 +3345,20 @@ if (x) *str = *ret = '='; + /* quote commas inside brace expansions */ + if (brbeg) { + char *u = ret; + char *v; + + v = ret = hcalloc(2 * strlen(u) + 1); + while (*u) { + if (*u == ',') + *v++ = '\\'; + *v++ = *u++; + } + *v = '\0'; + } + return ret; } This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.