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

Re: Space-expansion problem in dev-8



> If a filename contains spaces (or other escapable characters) and you
> expand it via wild-carding, the spaces are not escaped.

The fix is probably something like the following, but Sven may have better
ideas.  This is leaving my cursor at the end of the word for some reason.
Probably _expand was written before ${(q)...} existed.

Index: Completion/Core/_expand
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v
retrieving revision 1.33
diff -u -r1.33 _expand
--- Completion/Core/_expand	2000/10/11 12:19:24	1.33
+++ Completion/Core/_expand	2001/02/01 17:46:47
@@ -68,7 +68,7 @@
 # Now try globbing.
 
 [[ "$force" = *g* ]] || zstyle -T ":completion:${curcontext}:" glob &&
-    eval 'exp=( ${~exp} ); exp=( ${exp//(#b)([][()|*?^#~<>\\=])/\\${match[1]}} )' 2>/dev/null
+    eval 'exp=( ${~exp} ); exp=( ${(q)exp} )' 2>/dev/null
 
 # If we don't have any expansions or only one and that is the same
 # as the original string, we let other completers run.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



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