* PATCH: Re: trap ""
@ 2000-04-10 14:14 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-04-10 14:14 UTC (permalink / raw)
To: zsh-workers
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@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-04-10 14:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-10 14:14 PATCH: Re: trap "" Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).