zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Quote components before using it is pattern
@ 2008-10-13 23:01 Jörg Sommer
  2008-10-14 15:01 ` Jörg Sommer
  0 siblings, 1 reply; 7+ messages in thread
From: Jörg Sommer @ 2008-10-13 23:01 UTC (permalink / raw)
  To: zsh-workers; +Cc: Jörg Sommer

A component might contain a character active in patterns, like * or ().
Take for example the path /tmp/foobar). Passing this and /tmp/foo123 as a
completion to _multi_parts results in an error:

_multi_parts:147: bad pattern: (foo123|foobar))*

The characters in the temporary variable tmp1 must be quote, before the
pattern is build with them.
---
 Completion/Base/Utility/_multi_parts |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Completion/Base/Utility/_multi_parts b/Completion/Base/Utility/_multi_parts
index 615ef79..6fb6cbd 100644
--- a/Completion/Base/Utility/_multi_parts
+++ b/Completion/Base/Utility/_multi_parts
@@ -144,7 +144,7 @@ while true; do
 	SUFFIX="$suf"
       fi
 
-      matches=( "${(@M)matches:#(${(j:|:)~tmp1})*}" )
+      matches=( "${(@M)matches:#(${(j:|:)~${(q)tmp1}})*}" )
 
       if ! zstyle -t ":completion:${curcontext}:" expand suffix ||
          [[ -n "$menu" || -z "$compstate[insert]" ]]; then
-- 
1.6.0.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-08-21 17:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-13 23:01 [PATCH] Quote components before using it is pattern Jörg Sommer
2008-10-14 15:01 ` Jörg Sommer
2010-08-21 12:46   ` Mikael Magnusson
2010-08-21 16:54     ` Bart Schaefer
2010-08-21 17:04       ` Mikael Magnusson
2010-08-21 17:12       ` Bart Schaefer
2010-08-21 17:25         ` Mikael Magnusson

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).