From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5863 invoked from network); 31 Aug 2006 00:56:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 31 Aug 2006 00:56:23 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 76702 invoked from network); 30 Aug 2006 15:56:13 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Aug 2006 15:56:13 -0000 Received: (qmail 23103 invoked by alias); 30 Aug 2006 15:56:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22660 Received: (qmail 23092 invoked from network); 30 Aug 2006 15:56:11 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 30 Aug 2006 15:56:11 -0000 Received: (qmail 76464 invoked from network); 30 Aug 2006 15:56:11 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 30 Aug 2006 15:56:09 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly32d.srv.mailcontrol.com (MailControl) with ESMTP id k7UFrqZB009621 for ; Wed, 30 Aug 2006 16:55:54 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Aug 2006 16:54:21 +0100 Date: Wed, 30 Aug 2006 16:54:15 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: completion bug in UTF-8 locale Message-Id: <20060830165415.6a335109.pws@csr.com> In-Reply-To: <20060829194935.4f504217.p.w.stephenson@ntlworld.com> References: <20060820071833.GA3850@localdomain> <20060820180151.6b23348c.p.w.stephenson@ntlworld.com> <20060820200808.GA4049@localdomain> <20060820231838.02e89c47.p.w.stephenson@ntlworld.com> <20060826182433.GA22324@fargo> <20060829194935.4f504217.p.w.stephenson@ntlworld.com> Organization: Cambridge Silicon Radio X-Mailer: Sylpheed version 2.2.6 (GTK+ 2.6.7; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 30 Aug 2006 15:54:21.0147 (UTC) FILETIME=[8EC4A2B0:01C6CC4C] X-Scanned-By: MailControl A-07-04-01 (www.mailcontrol.com) on 10.68.0.142 Peter Stephenson wrote: > On Sat, 26 Aug 2006 20:24:33 +0200 > David Gómez wrote: > > Hi Peter, > > I'm testing latest CVS and the completion bug is still present. My locale > > is different from Roman's one (es_ES.UTF-8) and my tests are with japanese > > characters: > > > > [~] % ls 花 > > aaaa bbbb > > > > And > > > > [~] % cd 花/ > > > > doesn't complete. > > Is this after plain "zsh -f"? I can see the problem there, although I > may not have a chance to look at it for a while since I'm in the middle > of some holiday (it's probably a fairly trivial missing piece of Meta > handling again). This fixes the problem in this case, although I still don't know if this is the only problem. This isn't new with MULTIBYTE_SUPPORT, although in the case of this character you'd be seeing other strange effects if you didn't have that turned on. Index: Src/Zle/compctl.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/compctl.c,v retrieving revision 1.27 diff -u -r1.27 compctl.c --- Src/Zle/compctl.c 30 May 2006 22:35:04 -0000 1.27 +++ Src/Zle/compctl.c 30 Aug 2006 15:50:33 -0000 @@ -2127,9 +2127,9 @@ { DIR *d; struct stat buf; - char *n, p[PATH_MAX], *q = NULL, *e; + char *n, p[PATH_MAX], *q = NULL, *e, *pathpref; LinkList l = NULL; - int ns = 0, ng = opts[NULLGLOB], test, aw = addwhat; + int ns = 0, ng = opts[NULLGLOB], test, aw = addwhat, pathpreflen; opts[NULLGLOB] = 1; @@ -2145,12 +2145,18 @@ all = execs = 0; } /* Open directory. */ - if ((d = opendir((prpre && *prpre) ? prpre : "."))) { + if (prpre && *prpre) { + pathpref = dupstring(prpre); + unmetafy(pathpref, &pathpreflen); + } else { + pathpref = NULL; + pathpreflen = 0; + } + if ((d = opendir(pathpref ? pathpref : "."))) { /* If we search only special files, prepare a path buffer for stat. */ - if (!all && prpre) { - strcpy(p, prpre); - q = p + strlen(prpre); - } + if (!all && pathpreflen) + memcpy(p, pathpref, pathpreflen); + q = p + pathpreflen; /* Fine, now read the directory. */ while ((n = zreaddir(d, 1)) && !errflag) { /* Ignore files beginning with `.' unless the thing we found on * -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php