zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: completion bug in UTF-8 locale
Date: Wed, 30 Aug 2006 16:54:15 +0100	[thread overview]
Message-ID: <20060830165415.6a335109.pws@csr.com> (raw)
In-Reply-To: <20060829194935.4f504217.p.w.stephenson@ntlworld.com>

Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> On Sat, 26 Aug 2006 20:24:33 +0200
> David Gómez <david@pleyades.net> 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 花/<Tab>
> > 
> > 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 <pws@csr.com>                  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


  reply	other threads:[~2006-08-31  0:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060820071833.GA3850@localdomain>
2006-08-20 17:01 ` Peter Stephenson
2006-08-20 20:08   ` Roman Cheplyaka
2006-08-20 22:18     ` Peter Stephenson
2006-08-26 18:24       ` David Gómez
2006-08-29 18:49         ` Peter Stephenson
2006-08-30 15:54           ` Peter Stephenson [this message]
2006-08-30 17:13             ` David Gómez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060830165415.6a335109.pws@csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).