Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Quote components before using it is pattern
- X-seq: zsh-workers 25883
- From: JÃrg Sommer <joerg@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: [PATCH] Quote components before using it is pattern
- Date: Tue, 14 Oct 2008 01:01:33 +0200
- Cc: JÃrg Sommer <joerg@xxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=gnuu.de; s=banki; t=1223938986; i=@xxxxxxxxxxxx; bh=DVoKs9KLPoCFX7LZuPXRHXuQKSzoqjRLd pMfCAKVHts=; h=From:To:Cc:Subject:Date:Message-Id; b=GQTOQPCFl79gI4 3un0OfA+bmgB5tfUImSx5s3e0JvSUib4f1hS/Y2pUqfPm0xD4xUkcBvGCvfXFG7qrlE AHXBhGyLzNClLxYKin48wCgWDP5xA8J8yyo53QNSATXJP0cADFEL0AIDvC5yCFREd45 QvbH90fShgzAMbeVpnLp5bQ=
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author