Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH 2/2] clear the heredoc list in case par_event() fails



On Friday, April 17, 2015 9:17:53 PM CET Peter Stephenson wrote:
> On Fri, 17 Apr 2015 15:25:55 +0200
> 
> Kamil Dudka <kdudka@xxxxxxxxxx> wrote:
> > ... in order to prevent SIGSEGV on the following input when running
> > in the interactive mode:
> > 
> > <<X;'
> > ^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

Attachment: parse-error.sh
Description: application/shellscript



Messages sorted by: Reverse Date, Date, Thread, Author