Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] ? Parse error does not always set $? (Was: Bug? Output not flushed?)
- X-seq: zsh-workers 52149
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [PATCH] ? Parse error does not always set $? (Was: Bug? Output not flushed?)
- Date: Fri, 15 Sep 2023 15:22:17 -0700
- Archived-at: <https://zsh.org/workers/52149>
- In-reply-to: <CAH+w=7ZiU+YY46hAVhR_8MoUmN6Mnxk8TFf9S3dgg_wkR16ajQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YnQmbVqNKHmt6nthB-+1KdFYhXt2vfVu2_uHP6S5RxMg@mail.gmail.com> <CAHYJk3QbXntu6F7MAcweg5m0iRXp0QmuSkdWP2DfDxNJ=TYHWg@mail.gmail.com> <CAH+w=7ZiU+YY46hAVhR_8MoUmN6Mnxk8TFf9S3dgg_wkR16ajQ@mail.gmail.com>
On Fri, Sep 15, 2023 at 10:30 AM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> Unless something is actually aborting the $(...)
Ah, part of the problem is upstream.
Is there any reason parse_string() should be discarding errflag? All
tests still pass with this change:
diff --git a/Src/exec.c b/Src/exec.c
index 3a8b3e951..f6902fd39 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -286,6 +286,7 @@ parse_string(char *s, int reset_lineno)
{
Eprog p;
zlong oldlineno;
+ int xerrflag;
zcontext_save();
inpush(s, INP_LINENO, NULL);
@@ -299,7 +300,9 @@ parse_string(char *s, int reset_lineno)
lastval = 1;
strinend();
inpop();
+ xerrflag = errflag;
zcontext_restore();
+ errflag = xerrflag;
return p;
}
That's not the only thing that was needed for the original nofork
problem, but the rest isn't relevant here.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author