From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16478 invoked by alias); 14 May 2015 17:07:51 -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: 35132 Received: (qmail 16678 invoked from network); 14 May 2015 17:07:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Message-ID: <5554D65B.8070500@inlv.org> Date: Thu, 14 May 2015 18:07:39 +0100 From: Martijn Dekker User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Peter Stephenson , zsh-workers@zsh.org Subject: Re: 'case' pattern matching bug with bracket expressions References: <55549FB2.80705@inlv.org> <20150514154238.0e547ff0@pwslap01u.europe.root.pri> <5554C3A5.4030205@inlv.org> <20150514171716.69cd99c9@pwslap01u.europe.root.pri> In-Reply-To: <20150514171716.69cd99c9@pwslap01u.europe.root.pri> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Peter Stephenson schreef op 14-05-15 om 17:17: > I don't *think* the following patch makes anything worse, Thanks for the patch. I just tested it against zsh 5.0.7-dev-2. It does solve the simple cases of: case abc in ( [] ) echo yes ;; ( * ) echo no ;; esac empty='' case abc in ( ["$empty"] ) echo yes ;; ( * ) echo no ;; esac which are now a non-match instead of an error, as I would expect. However, the more insidious case that bit me: case abc in ( [] | [!a-z]* ) echo yes ;; ( * ) echo no ;; esac empty='' case abc in ( ["$empty"] | [!a-z]* ) echo yes ;; ( * ) echo no ;; esac still produces a false positive even with the patch. - Martijn