From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24381 invoked by alias); 21 Aug 2010 16:54:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28184 Received: (qmail 12321 invoked from network); 21 Aug 2010 16:54:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100821095410.ZM31747@torch.brasslantern.com> Date: Sat, 21 Aug 2010 09:54:10 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "Re: [PATCH] Quote components before using it is pattern" (Aug 21, 2:46pm) References: <1223938893-2537-1-git-send-email-joerg@alea.gnuu.de> <20081014150144.GA3836@alea.gnuu.de> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: [PATCH] Quote components before using it is pattern MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Aug 21, 2:46pm, Mikael Magnusson wrote: } Subject: Re: [PATCH] Quote components before using it is pattern } } On 14 October 2008 17:01, Jorg Sommer wrote: Wow, digging back into history a bit here ... } >> A component might contain a character active in patterns, like * or (). } >> } >> The characters in the temporary variable tmp1 must be quote, before the } >> pattern is build with them. } } This patch sort of breaks completing when the first segment has spaces } for me. As has come up elsewhere, the problem is that ${(q)...} is a bit too aggressive for the purpose to which it is being put. We need to quote pattern characters in tmp1, but not other characters like spaces. There's a rather ugly hunk of code in _path_files that does something like this (see the comment "Explanation of substitution: ...") but unfortunately I don't have time this morning to try to adapt it for _multi_parts.