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

PATCH: Re: completion with a directory which contains a backslash



Tanaka Akira wrote:

> I found that completion has a problem when a directory contains a
> backslash.
> 
> Z(4):akr@serein% Src/zsh -f
> serein% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D
> serein% mkdir -p \\a/b/c
> serein% ls \\a/<TAB>
> ->
> serein% ls \\a/b
> 
> This should be following.
> 
> serein% ls \\a/b/

Indeed. It reported the unquoted path to compadd with the -W option
which should be correct. But then do_single() used ztat() to ignore
the backslash.

Bye
 Sven

Index: Src/Zle/compresult.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v
retrieving revision 1.9
diff -u -r1.9 compresult.c
--- Src/Zle/compresult.c	2000/04/25 10:28:11	1.9
+++ Src/Zle/compresult.c	2000/04/25 11:14:50
@@ -705,6 +705,9 @@
 {
     char b[PATH_MAX], *p;
 
+    if (!(ls ? lstat(nam, buf) : stat(nam, buf)))
+	return 0;
+
     for (p = b; p < b + sizeof(b) - 1 && *nam; nam++)
 	if (*nam == '\\' && nam[1])
 	    *p++ = *++nam;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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