Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh heredoc crash
- X-seq: zsh-workers 39305
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: zsh heredoc crash
- Date: Tue, 13 Sep 2016 09:29:51 +0100
- Cms-type: 201P
- In-reply-to: <20160912232522.GA16602@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CAHAq8pEm1FHNvoUJUq2t86P-QKtMdT3uScDUGn-dCscJUGvWew@mail.gmail.com> <25855010.qczLe9GZ8n@kdudka-nb> <20160909173515.4cb8392e@pwslap01u.europe.root.pri> <160909180250.ZM19582@torch.brasslantern.com> <CGME20160912232639eucas1p14a2672585f9eddbcbc1d5d8212dc6401@eucas1p1.samsung.com> <20160912232522.GA16602@fujitsu.shahaf.local2>
On Mon, 12 Sep 2016 23:25:22 +0000
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> There seems to be a logic error in gethere():
>
> if (!errflag) {
> /* Retain any user interrupt error */
> errflag = ef | (errflag & ERRFLAG_INT);
> }
I think the intention is the following:
- If there's a (synchronous) error from parsestr(), return that.
- If there isn't, keep the previous error status, but also keep
any (asynchronous) interrupt flag.
pws
diff --git a/Src/exec.c b/Src/exec.c
index 2e251b9..cfd633a 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4034,7 +4034,7 @@ gethere(char **strp, int typ)
parsestr(&buf);
- if (!errflag) {
+ if (!(errflag & ERRFLAG_ERROR)) {
/* Retain any user interrupt error */
errflag = ef | (errflag & ERRFLAG_INT);
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author