From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id f53a61c3 for ; Thu, 29 Nov 2018 16:31:31 +0000 (UTC) Received: (qmail 8480 invoked by alias); 29 Nov 2018 16:31:16 -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: List-Unsubscribe: X-Seq: 43852 Received: (qmail 2253 invoked by uid 1010); 29 Nov 2018 16:31:16 -0000 X-Qmail-Scanner-Diagnostics: from mx1.redhat.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.132.183.28):SA:0(-6.9/5.0):. Processed in 1.97053 secs); 29 Nov 2018 16:31:16 -0000 X-Envelope-From: kdudka@redhat.com X-Qmail-Scanner-Mime-Attachments: |parse-error.sh| X-Qmail-Scanner-Zip-Files: | From: Kamil Dudka To: Peter Stephenson Cc: zsh-workers@zsh.org Subject: Re: [PATCH 2/2] clear the heredoc list in case par_event() fails Date: Thu, 29 Nov 2018 17:24:56 +0100 Message-ID: <2172016.U8TV6t29ou@kdudka-nb> In-Reply-To: <20150417201753.41812294@ntlworld.com> References: <1429277155-24607-1-git-send-email-kdudka@redhat.com> <1429277155-24607-2-git-send-email-kdudka@redhat.com> <20150417201753.41812294@ntlworld.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart1812224.Cez95dLk8A" Content-Transfer-Encoding: 7Bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 29 Nov 2018 16:24:17 +0000 (UTC) --nextPart1812224.Cez95dLk8A Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Friday, April 17, 2015 9:17:53 PM CET Peter Stephenson wrote: > On Fri, 17 Apr 2015 15:25:55 +0200 > > Kamil Dudka wrote: > > ... in order to prevent SIGSEGV on the following input when running > > in the interactive mode: > > > > < > ^C > > > > ^C > > I think that still leaves cruft around of other kinds. I think the fix > is something like the following. > > diff --git a/Src/parse.c b/Src/parse.c > index 91a81e1..985eb8e 100644 > --- a/Src/parse.c > +++ b/Src/parse.c > @@ -605,6 +605,7 @@ par_event(int endtok) > if (!par_event(endtok)) { > ecused = oec; > ecbuf[p] |= wc_bdata(Z_END); > + return errflag ? 0 : 1; > } > } > return 1; > > pws Since the above patch was applied, zsh exits successfully (despite it reports parse error) on the attached example: % zsh parse-error.sh; echo $? parse-error.sh:4: parse error 0 Is this expected? Kamil --nextPart1812224.Cez95dLk8A Content-Disposition: attachment; filename="parse-error.sh" Content-Transfer-Encoding: base64 Content-Type: application/x-shellscript; name="parse-error.sh" Y2F0IDw8RU9GCiQocHJpbnQgPDxYWFgKRU9GCg== --nextPart1812224.Cez95dLk8A--