Op 29-11-18 om 21:39 schreef Harald van Dijk:
By the way, my change has an unintended but possibly acceptable side
effect:
trap '(trap "echo exit" EXIT; :)' EXIT
This prints nothing with current dash, but prints "exit" with my change.
It also prints "exit" in ksh, mksh, posh, and bosh.
I
On 29/11/2018 20:28, Martijn Dekker wrote:
Op 29-11-18 om 20:56 schreef Harald van Dijk:
That's part of it, but not the whole story. Herbert Xu's comment about
exitshell() was right, that is still a problem. A testcase for this is
trap '(true) || echo bug' EXIT
Yes. Thanks. I hadn't thoug
Op 29-11-18 om 20:56 schreef Harald van Dijk:
That's part of it, but not the whole story. Herbert Xu's comment about
exitshell() was right, that is still a problem. A testcase for this is
trap '(true) || echo bug' EXIT
Yes. Thanks. I hadn't thought about that.
The test case above is not q
On 29/11/2018 15:45, Martijn Dekker wrote:
Op 27-11-18 om 17:24 schreef Martijn Dekker:
Big bad bug: it appears that subshells always return status 0 in traps.
As posted elsewhere, looks like the problem is simply that savestatus
("/* exit status of last command outside traps */") isn't reset
Op 27-11-18 om 17:24 schreef Martijn Dekker:
Big bad bug: it appears that subshells always return status 0 in traps.
As posted elsewhere, looks like the problem is simply that savestatus
("/* exit status of last command outside traps */") isn't reset to -1
upon resetting traps when forking a
Op 27-11-18 om 17:24 schreef Martijn Dekker:
Big bad bug: it appears that subshells always return status 0 in traps.
Bug found in dash 0.5.9 and later.
In fact, the bug exists on at least dash 0.5.6 and possibly earlier
(earlier versions don't compile for me) if the exit occurs due to a
fail
Op 29-11-18 om 15:48 schreef Herbert Xu:
The problem is that in evalsubshell we end up in exitshell again
which restores the old exit status. So we need to come up with
a way to differentiate the exitshell from the original shell vs.
a subshell.
Isn't it much simpler than that? Upon forking a
On Thu, Nov 29, 2018 at 03:27:31PM +0100, Martijn Dekker wrote:
> Op 29-11-18 om 12:33 schreef Herbert Xu:
> > Thanks for the report. This patch should fix the problem:
>
> Doesn't work for me, in fact it seems to make no difference.
>
> Here are a few more test cases.
>
> (trap '(! :) && echo
Op 29-11-18 om 12:33 schreef Herbert Xu:
Thanks for the report. This patch should fix the problem:
Doesn't work for me, in fact it seems to make no difference.
Here are a few more test cases.
(trap '(! :) && echo BUG1' EXIT)
(trap '(false) && echo BUG2' EXIT)
(trap 'readonly foo=bar; (foo=ba
Martijn Dekker wrote:
> Big bad bug: it appears that subshells always return status 0 in traps.
>
> Bug found in dash 0.5.9 and later.
>
> $ src/dash -c 'trap "(false) && echo BUG" INT; kill -s INT $$'
> BUG
> $ src/dash -c 'trap "(false) && echo BUG" EXIT'
> BUG
> $ src/dash -c 'trap "(false);
10 matches
Mail list logo