From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19953 invoked by alias); 15 May 2015 08:56:44 -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: 35152 Received: (qmail 18185 invoked from network); 15 May 2015 08:56:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f5-f794b6d000001495-77-5555b26bbb79 Date: Fri, 15 May 2015 09:46:14 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: PATCH: quote parameter expansion from GLOB_SUBST Message-id: <20150515094614.727b76e8@pwslap01u.europe.root.pri> In-reply-to: <25543.1431640232@thecus.kiddle.eu> References: <20150510004444.0f7d5444@ntlworld.com> <25543.1431640232@thecus.kiddle.eu> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMLMWRmVeSWpSXmKPExsVy+t/xK7rZm0JDDXY8kbU42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGVM+32QpuM1ZMWH7HNYGxt3sXYycHBICJhJTb21ggbDFJC7c W8/WxcjFISSwlFHiX/9dJghnBpPE+oMHwDqEBLYxSkydlwBiswioSqz9v4YNxGYTMJSYumk2 I4gtIqAlsePkSSYQW1jAVuLcy1awOK+AvcT8na/A5nAKGEisvtvEAjEzQmJW+1SwGn4BfYmr fz8xQVxkLzHzyhmoXkGJH5PvgdUzA83fvK2JFcKWl9i85i0zxBx1iRt3d7NPYBSahaRlFpKW WUhaFjAyr2IUTS1NLihOSs810itOzC0uzUvXS87P3cQICdqvOxiXHrM6xCjAwajEw3uCNTRU iDWxrLgy9xCjBAezkgjv7HVAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rwzd70PERJITyxJzU5N LUgtgskycXBKNTCu2vjn4iHlrKW8R+KzbKI1L+9hqND/6zf9iMR8vYdfbrw5J+C//+tJIa60 fVETmYUnng28E/7suOSFFTaCHGkXN/ybzasn5fOgpuW3z+z780+dk8jmPlpRv33DvDOdd5j3 Rx4M8lt7sla3ZC3nAbPOYgkRF4uKrd9Uj/SoO1q0iZUIed/jDpZUYinOSDTUYi4qTgQAMrTt 8FYCAAA= On Thu, 14 May 2015 23:50:32 +0200 Oliver Kiddle wrote: > On 10 May, Peter wrote: > > the (b) parameter flag to backslash-quote against pattern characters > > Playing with this, I managed to get a BUG message: > > % a='*' > % echo ${(bqq)a} > utils.c:5104: BUG: bad quote type in quotestring > '*' I tested one way round (q first) but not the other. > We've got (q-) for minimal quoting. If - is a sort of parameter to q, > perhaps we should continue that: (q*) might be more memorable. And > combining (b) with (q) is a bit odd anyway. I thought about an argument to q, but nothing struck me as particularly obvious, so I left q for generic quoting (all forms produced by any q variant at the moment protect all characters by some means or another so are e.g. eval safe --- up to bugs). pws diff --git a/Src/subst.c b/Src/subst.c index bf80495..6345e36 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -1845,7 +1845,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags) break; case 'q': - if (quotetype == QT_DOLLARS) + if (quotetype == QT_DOLLARS || QT_BACKSLASH_PATTERN) goto flagerr; if (s[1] == '-') { if (quotemod)