* Trap bug?
@ 1998-01-09 11:11 Bernd Eggink
0 siblings, 0 replies; only message in thread
From: Bernd Eggink @ 1998-01-09 11:11 UTC (permalink / raw)
To: zsh-workers mailing list
This doesn't work correctly in 3.1.2:
function f
{
( trap 'print "INT f"; return 0' INT
while true; do :; done
)
print "Leaving f"
}
f
print "Leaving script"
Hitting Ctrl-C during the loop in f causes an immediate exit from the
_script_, not just a return from the function, as it should (IMHO).
If the trap command is outside the parentheses, it works:
function f
{ trap 'print "INT f"; return 0' INT
(
while true; do :; done
)
print "Leaving f"
}
But then the traps won't be automatically restored before leaving the
function, which is what I intended.
Bernd
--
Bernd Eggink
Regionales Rechenzentrum der Uni Hamburg
eggink@rrz.uni-hamburg.de
http://www.rrz.uni-hamburg.de/eggink/BEggink.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-01-09 11:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-09 11:11 Trap bug? Bernd Eggink
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).