From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15315 invoked by alias); 15 May 2015 20:48:32 -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: 35156 Received: (qmail 13257 invoked from network); 15 May 2015 20:48:29 -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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 X-Originating-IP: [80.3.228.158] X-Spam: 0 X-Authority: v=2.1 cv=dtgmcAU4 c=1 sm=1 tr=0 a=P+FLVI8RzFchTbbqTxIDRw==:117 a=P+FLVI8RzFchTbbqTxIDRw==:17 a=kj9zAlcOel0A:10 a=NLZqzBF-AAAA:8 a=hD80L64hAAAA:8 a=lpseQW1CLXmZ11k1264A:9 a=CjuIK1q_8ugA:10 Date: Fri, 15 May 2015 21:48:25 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: 'case' pattern matching bug with bracket expressions Message-ID: <20150515214825.124dcf03@ntlworld.com> In-Reply-To: <20150515093851.57b973bc@pwslap01u.europe.root.pri> References: <55549FB2.80705@inlv.org> <20150514154238.0e547ff0@pwslap01u.europe.root.pri> <5554C3A5.4030205@inlv.org> <20150514165557.59f6bdc9@pwslap01u.europe.root.pri> <20150515093851.57b973bc@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 15 May 2015 09:38:51 +0100 Peter Stephenson wrote: > I don't think changing the case parsing to do proper words is *that* > difficult --- it's always been a bit of a hack, so could do with > being fixed. I'm on the case, but just to note this isn't completely benign. There are (few) places in functions where we rely on the fact that anything in parentheses is parsed as a single quoted string, which won't happen any more. In particular, this one from _path_commands running in the completion tests had me stumped for half an hour: _call_whatis() { case "$(whatis --version)" in (whatis from *) local -A args zparseopts -D -A args s: r: apropos "${args[-r]:-"$@"}" | fgrep "($args[-s]" ;; (*) whatis "$@";; esac } Quoting "whatis from " fixes it. No doubt we can track these down in functions in the distribution but it could also crop up elsewhere. I don't want to have to propagate the existing hack any more, however, so this isn't really possible to work around. The better news is it gives a clear parse error (except in completion tests where errors are obscurely hidden). So perhaps it isn't so bad if flagged up as a change. pws