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

Re: Strange bug when completing [ in file names



On 16 Jan, Tobias Gruetzmacher wrote:

> I have a very strange problem when completing files in directories under 
> my home directory. The problem only occours when I start the file name 
> with ~ and have a [ somewhere in the file name. Some short test case:

Looks like the handling of the suffix style in _expand is seeing the `['
character and assuming that we have a glob pattern in there. But we
don't: the `[' is quoted. The following patch fixes it.

Oliver

Index: Completion/Base/Completer/_expand
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Completer/_expand,v
retrieving revision 1.9
diff -u -r1.9 _expand
--- Completion/Base/Completer/_expand   7 Aug 2004 15:27:29 -0000       1.9
+++ Completion/Base/Completer/_expand   20 Jan 2005 11:03:32 -0000
@@ -35,7 +35,7 @@
 
 zstyle -T ":completion:${curcontext}:" suffix &&
   [[ "$word" = (\~*/*|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\$\{*\}?) &&
-     "${(e)word}" != *[][^*?\(\)\<\>\{\}\|]* ]] &&
+     "${(e)word}" != *[^\\][][^*?\(\)\<\>\{\}\|]* ]] &&
   return 1
 
 zstyle -s ":completion:${curcontext}:" accept-exact tmp ||



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