From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29988 invoked by alias); 19 Jan 2016 17:35:18 -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: 37693 Received: (qmail 2126 invoked from network); 19 Jan 2016 17:35:17 -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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f5-f79b16d000005389-81-569e73d1bb9c Date: Tue, 19 Jan 2016 17:35:11 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [BUG] quoting within bracket patterns has no effect Message-id: <20160119173511.53b92033@pwslap01u.europe.root.pri> In-reply-to: References: <569C68AB.2010806@inlv.org> <20160118172434.2fb7d5b9@pwslap01u.europe.root.pri> 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+NgFrrILMWRmVeSWpSXmKPExsVy+t/xa7oXi+eFGZzbb21xsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4Mt6dmcNYsImr4sbCuawNjA0cXYycHBICJhJTDk9igbDFJC7c W88GYgsJLGWUuPuYvYuRC8iewSSx7lUXE4RzjlHi+L+TjBDOWUaJFYu72EFaWARUJWbfPwg2 ik3AUGLqptmMILaIgLjE2bXnweLCAg4S1++3gdXzCthLrPm2nwnE5hRwlZjZPZENah2jRP/C LmaQBL+AvsTVv5+YIO6zl5h55QwjRLOgxI/J98CGMgtoSWze1sQKYctLbF7zlhniB3WJG3d3 s09gFJ6FpGUWkpZZSFoWMDKvYhRNLU0uKE5KzzXSK07MLS7NS9dLzs/dxAgJ6K87GJceszrE KMDBqMTD+8JxbpgQa2JZcWXuIUYJDmYlEd5lefPChHhTEiurUovy44tKc1KLDzFKc7AoifPO 3PU+REggPbEkNTs1tSC1CCbLxMEp1cB4ZI7Xzf1zgz/X3MjzfxB0db+2Jr+9nqfPUnv12iDb vfqSvSmxSr23v+fUH/efWpH0zGsho7pc8MK2h8yCe05wGYp986nsYV1U3VH1Lzp5f2FomXhd Ds+kqW9sZl2X21MpfaBgz/krBY01XbO3sf+aIe4ZnLqQc/UZg+eT2yzNFKd96Pm0rEaJpTgj 0VCLuag4EQCBCwjkZAIAAA== On Wed, 20 Jan 2016 00:57:30 +0900 Jun T. wrote: > In glob.c, switch statement from line 1298, > *s is not '-' but Dash, and not handled by > case '-': > at line 1316. It looks like glob qualifiers are a grey area for tokenisation, with arguments that should be untokenised but aren't (so far as I can see), so it's not necessarily just that case. Short of rewriting it, this is about the best I can see, and ought to be OK for -, but I suspect this is just the tip of the iceberg. However, maybe it gets tidied up later somewhere I haven't noticed so just handling the case statement would actually work. pws diff --git a/Src/glob.c b/Src/glob.c index c799281..69de155 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -1230,7 +1230,7 @@ zglob(LinkList list, LinkNode np, int nountok) char *s; int sense, qualsfound; off_t data; - char *sdata, *newcolonmod; + char *sdata, *newcolonmod, *ptr; int (*func) _((char *, Statptr, off_t, char *)); /* @@ -1273,6 +1273,9 @@ zglob(LinkList list, LinkNode np, int nountok) *s++ = 0; if (qualsfound == 2) s += 2; + for (ptr = s; *ptr; ptr++) + if (*ptr == Dash) + *ptr = '-'; while (*s && !newcolonmod) { func = (int (*) _((char *, Statptr, off_t, char *)))0; if (idigit(*s)) {