Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: trap ""
- X-seq: zsh-workers 10625
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: trap ""
- Date: Mon, 10 Apr 2000 16:14:19 +0200 (MET DST)
- In-reply-to: Tanaka Akira's message of 08 Apr 2000 01:57:42 +0900
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Tanaka Akira wrote:
> I found that
>
> zsh -c 'trap "" 2; cat'
>
> can be exited by ^C. Since zsh-3.1.6-dev-17, at least.
>
> zsh-3.1.6-dev-15 or before doesn't exit and zsh-3.1.6-dev-16 dumps
> core.
The problem was that the signal code didn't correctly found out if an
eprog was empty. There is now the function empty_eprog() for this.
Bye
Sven
Index: Src/parse.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/parse.c,v
retrieving revision 1.4
diff -u -r1.4 parse.c
--- Src/parse.c 2000/04/05 09:20:04 1.4
+++ Src/parse.c 2000/04/10 14:12:36
@@ -399,6 +399,13 @@
return ret;
}
+/**/
+mod_export int
+empty_eprog(Eprog p)
+{
+ return (!p || !p->prog || *p->prog == WCB_END());
+}
+
/*
* event : ENDINPUT
* | SEPER
Index: Src/signals.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/signals.c,v
retrieving revision 1.1.1.27
diff -u -r1.1.1.27 signals.c
--- Src/signals.c 2000/03/14 11:12:15 1.1.1.27
+++ Src/signals.c 2000/04/10 14:12:37
@@ -696,7 +696,7 @@
unsettrap(sig);
sigfuncs[sig] = l;
- if (!l) {
+ if (empty_eprog(l)) {
sigtrapped[sig] = ZSIG_IGNORED;
if (sig && sig <= SIGCOUNT &&
#ifdef SIGWINCH
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author