Re: Pending signal in EXIT trap causes pattern matching to fail

2022-12-08 Thread Chet Ramey
On 12/7/22 11:24 AM, Andreas Schwab wrote: On Okt 12 2022, Chet Ramey wrote: But that's not really the issue right here. The question is whether the shell should process additional terminating signals while it's running the exit trap from the terminating signal handler. The problem is that th

Re: Pending signal in EXIT trap causes pattern matching to fail

2022-12-07 Thread Andreas Schwab
On Okt 12 2022, Chet Ramey wrote: > But that's not really the issue right here. The question is whether the > shell should process additional terminating signals while it's running the > exit trap from the terminating signal handler. The problem is that the shell becomes uninterruptable while run

Re: Pending signal in EXIT trap causes pattern matching to fail

2022-10-12 Thread Chet Ramey
On 10/12/22 11:23 AM, Andreas Schwab wrote: gmatch in lib/glob/sm_loop.c returns FNM_NOMATCH when a signal is pending. This can cause spurious pattern matching failures if a SIGPIPE is received while executing the EXIT trap: OK. An interrupt or a terminating signal, yes. Since gmatch and extma

Pending signal in EXIT trap causes pattern matching to fail

2022-10-12 Thread Andreas Schwab
gmatch in lib/glob/sm_loop.c returns FNM_NOMATCH when a signal is pending. This can cause spurious pattern matching failures if a SIGPIPE is received while executing the EXIT trap: $ cat trap.sh trap 'set -x; echo trap; case a in *) echo match >&2;; esac; echo done >&2' EXIT while :; do :; done $