From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14804 invoked from network); 11 Oct 2008 21:54:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL autolearn=unavailable version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Oct 2008 21:54:00 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 77142 invoked from network); 11 Oct 2008 21:53:26 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Oct 2008 21:53:26 -0000 Received: (qmail 12492 invoked by alias); 11 Oct 2008 21:53:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25845 Received: (qmail 12463 invoked from network); 11 Oct 2008 21:53:05 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 11 Oct 2008 21:53:05 -0000 Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by bifrost.dotsrc.org (Postfix) with ESMTP id A6AEB80308BA for ; Sat, 11 Oct 2008 23:52:59 +0200 (CEST) Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20081011215258.PDEE2285.mtaout01-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Sat, 11 Oct 2008 22:52:58 +0100 Received: from pws-pc ([81.107.43.40]) by aamtaout01-winn.ispmail.ntl.com with ESMTP id <20081011215258.TNDL19264.aamtaout01-winn.ispmail.ntl.com@pws-pc>; Sat, 11 Oct 2008 22:52:58 +0100 Date: Sat, 11 Oct 2008 22:52:55 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Cc: 501851@bugs.debian.org Subject: Re: Bug#501851: zsh: Completion fails if a directory name contains '(', ')' and =?UTF-8?B?J8SE?= '. Message-ID: <20081011225255.0df2e350@pws-pc> In-Reply-To: <48F0AE88.1020307@inz.sakura.ne.jp> References: <20081010230611.23133.42221.reportbug@debian> <20081010231712.GA20915@scru.org> <48F0AE88.1020307@inz.sakura.ne.jp> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Cloudmark-Analysis: v=1.0 c=1 a=xwFHshQBCqYA:10 a=v66L8OmKkSMA:10 a=BDfLYcxwHvxgNJtmXFQA:9 a=JN_6wM2NEmdH0IlaltkA:7 a=vwklE4o4yvaXPGsitfrBNbaQjqwA:4 a=LY0hPdMaydYA:10 X-Virus-Scanned: ClamAV 0.92.1/8412/Sat Oct 11 14:30:20 2008 on bifrost X-Virus-Status: Clean On Sat, 11 Oct 2008 22:47:52 +0900 Morita Sho wrote: > $~tmp1 expansion seems not working correctly for a pattern '\(\)=C4=84/*'. Thanks for the clear analysis. The pattern gets divided up into chunks because of the backslashed characters, but we don't report that it wasn't a pure string on that basis, so the directory trise to match the wrong string. This was triggered in this case because of the character in a range that zsh has to quote internally to avoid clashing with tokens, which is why it occurred with some forms of accent but not others. I could optimise this better but this is a simple change for now. Index: Src/pattern.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/zsh/zsh/Src/pattern.c,v retrieving revision 1.47 diff -u -r1.47 pattern.c --- Src/pattern.c 8 Jun 2008 17:53:55 -0000 1.47 +++ Src/pattern.c 11 Oct 2008 21:44:35 -0000 @@ -1446,7 +1446,13 @@ * Marker for restoring a backslash in output: * does not match a character. */ - return patcomppiece(flagp); + next =3D patcomppiece(flagp); + /* + * Can't match a pure string since we need to do this + * as multiple chunks. + */ + *flagp &=3D ~P_PURESTR; + return next; break; #ifdef DEBUG default: Index: Test/D07multibyte.ztst =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/zsh/zsh/Test/D07multibyte.ztst,v retrieving revision 1.25 diff -u -r1.25 D07multibyte.ztst --- Test/D07multibyte.ztst 26 Mar 2008 15:26:20 -0000 1.25 +++ Test/D07multibyte.ztst 11 Oct 2008 21:44:35 -0000 @@ -395,3 +395,14 @@ >OK >OK >OK + + mkdir glob + mkdir glob/'()=C4=84' glob/'()=C4=80' + mkdir glob/'()=C4=84'/foo glob/'()=C4=80'/bar + tmp1=3D('glob/\(\)=C4=84/*') + print $~tmp1 + tmp1=3D('glob/\(\)=C4=80/*') + print $~tmp1 +0:Backslashes and metafied characters in patterns +>glob/()=C4=84/foo +>glob/()=C4=80/bar