Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: BUG: "setopt autocd" and auto-cd completion of dirs with funny (Unicode) chars



Fernando Vezzosi <fvezzosi@xxxxxxxxxxx> wrote:
> Hi -workers,
> zsh-beta 4.3.2-dev-1+20070413-1 on Debian Sid (i686-pc-linux-gnu)
> here..
> 
> I use zsh-beta because the plain zsh package doesn't complete
> Unicode (UTF-8) filenames and dirs.  With zsh-beta it's much better,
> but it fails when auto-cd`ing into some Unicode-named directory..

Aha... you're using raw out-of-the-box completion, not compinit, right?

Index: Src/Zle/compctl.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compctl.c,v
retrieving revision 1.31
diff -u -r1.31 compctl.c
--- Src/Zle/compctl.c	3 Dec 2006 21:07:18 -0000	1.31
+++ Src/Zle/compctl.c	27 Apr 2007 16:00:44 -0000
@@ -2188,9 +2188,14 @@
 		if (!test)
 		    continue;
 		if (!all) {
+		    char *ums;
+		    int umlen;
 		    /* We still have to check the file type, so
prepare *
 		     * the path buffer by appending the
filename.       */
-		    strcpy(q, n);
+		    ums = dupstring(n);
+		    unmetafy(ums, &umlen);
+		    memcpy(q, ums, umlen);
+		    q[umlen] = '\0';
 		    /* And do the stat. */
 		    if (stat(p, &buf) < 0)
 			continue;

-- 
Peter Stephenson <pws@xxxxxxx>                  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

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview



Messages sorted by: Reverse Date, Date, Thread, Author