From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22718 invoked by alias); 16 Feb 2015 19:39:29 -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: 34561 Received: (qmail 28587 invoked from network); 16 Feb 2015 19:39:27 -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,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=I4zSn2kl c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=0HtSIViG9nkA:10 a=Gcs_mEAoZWJg2NsytMQA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <150216113923.ZM5698@torch.brasslantern.com> Date: Mon, 16 Feb 2015 11:39:23 -0800 In-reply-to: <20150216170413.054623af@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: PATCH: Crash bug on garbage input (previously reported to Debian)" (Feb 16, 5:04pm) References: <150214102534.ZM4368@torch.brasslantern.com> <20150214214209.6d2f5e7e@ntlworld.com> <150215112622.ZM11584@torch.brasslantern.com> <20150216125749.7a26822c@pwslap01u.europe.root.pri> <20150216170413.054623af@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: PATCH: Crash bug on garbage input (previously reported to Debian) MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Feb 16, 5:04pm, Peter Stephenson wrote: } } I've add the "parse test from hell" where the first line looks like an } arithmetic substitution but it actually turns out to be a case statement } with unbalanced parentheses that needs the new parsing behaviour. There's an interesting bit of this which I don't think is actually a change in behavior but which might be worth noting. Interactive shell: torch% print $((case foo in mathsubst> If you send-break (ctrl+c) at this point, the input is entirely discarded and can't be recalled with up-line-or-history. Incidentally, it would probably be possible for the mathsubst parser to reject "case foo in" as impossible syntax a lot sooner, because if you simply close with "))" at that point you get zsh: bad math expression: operator expected at `foo in' but anyway: torch% print $((case foo in mathsubst> bar) cmdsubst subsh case> If you send-break at THIS point, the incomplete input ends up in the history and is recallable. Also, if you begin with "{" or "(" so that the PS2 level includes "subsh" or "cursh" then the input is recallable. Another tidbit: Older versions of the shell would only have cmdsubst> as the second PS2 prompt, so this is nice.