trap: Preserve parent traps for trap-only command substitution
commit94b1e82588289a477933f7075db7f098d4755fad
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 20 Apr 2024 00:36:04 +0000 (20 08:36 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 28 Apr 2024 00:51:10 +0000 (28 08:51 +0800)
treefbd1df4f551dbee1dfd6187622a73fede4a2eaeb
parent7a11b3e330a36a2c33607ac77ceca656038b3798
trap: Preserve parent traps for trap-only command substitution

Traps are reset when a subshell is started.  When a subshell is
started for command substitution with a simple command whose first
word is "trap", preserve the parent trap text so that they can be
printed.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
src/eval.c
src/init.h
src/jobs.c
src/mkinit.c
src/trap.c