On Mon, Sep 6, 2021 at 12:14 AM Roberto A. Foglietta <[email protected]> wrote: > Il giorno dom 5 set 2021 alle ore 21:40 Denys Vlasenko > <[email protected]> ha scritto: > > > > On Sun, Sep 5, 2021 at 5:53 PM Roberto A. Foglietta > > <[email protected]> wrote: > > > Il giorno dom 5 set 2021 alle ore 17:03 Denys Vlasenko > > > <[email protected]> ha scritto: > > > > > > > @@ -468,7 +470,11 @@ struct globals_misc { > > > > /* indicates specified signal received */ > > > > uint8_t gotsig[NSIG - 1]; /* offset by 1: "signal" 0 is > > > > meaningless */ > > > > uint8_t may_have_traps; /* 0: definitely no traps are set, 1: > > > > some traps may be set */ > > > > - char *trap[NSIG]; > > > > + char *trap[NSIG + 1]; > > > > +/* trap[0] is EXIT trap, trap[NTRAP_ERR] is ERR trap, other trap[i] > > > > are signal traps */ > > > > +#define NTRAP_ERR NSIG > > > > +#define NTRAP_LAST NSIG > > > > > > If NTRAP_LAST is defined as NSIG + 1 then char *trap[NSIG + 1]; could > > > become trap[NTRAP_LAST]. > > > > If NTRAP_LAST is defined as NSIG + 1, then its name would be lying to people > > reading the code: it says "the last trap number", but it would actually mean > > "the number of existing traps". > > I see your point.
I committed the change which added bash-like ERR trap and set -E. I am pushing two fixes from dash on top of it (one is touching the "set -E" code). _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
