* Re: interrupting loops
[not found] <9504190520.AA12684@eggman.uucp>
@ 1995-06-08 18:53 ` P.Stephenson
0 siblings, 0 replies; only message in thread
From: P.Stephenson @ 1995-06-08 18:53 UTC (permalink / raw)
To: zsh-list
Just found this old message:
mark%eggman.uucp@nosc.mil wrote:
> Richard writes:
> >> prompt% for x in 1 2 3 4 5; do
> >> > echo $x
> >> > sleep 1
> >> > done
> >> If you try to interrupt that loop, the sleep command gets interrupted,
> >> but then the loop continues with the next iteration. I tried the same
> >> loop on ksh and sh, and both of the popped out of the loop just fine.
> >
> >I'm not able to duplicate this. What machine type and zsh options
> >are you using?
> It looks like it's triggered by my having a TRAPZERR function defined.
dotrap() was being called although the function itself didn't do
anything because of the error flag. I've put a test into dotrap(),
but note the comment. The last part of the comment refers to another
bug I found at the same time which I'll post separately.
*** Src/signals.cerrt Wed May 31 05:10:36 1995
--- Src/signals.c Thu Jun 8 19:48:18 1995
***************
*** 681,688 ****
sav = sigtrapped[sig];
savval = lastval;
! if (sav == 2) /* if signal is being ignored, return */
return;
sigtrapped[sig] = 2;
if (sigfuncs[sig]) {
Lklist args;
--- 681,696 ----
sav = sigtrapped[sig];
savval = lastval;
! if (errflag || sav == 2)
return;
+ /* If signal is being ignored, return.
+ *
+ * Also return if errflag is set. In fact, the code in the
+ * function will test for this, but this way we keep status flags
+ * intact without working too hard. Special cases (e.g. calling
+ * a trap for SIGINT after the error flag was set) are handled
+ * by the calling code. (PWS 1995/06/08).
+ */
sigtrapped[sig] = 2;
if (sigfuncs[sig]) {
Lklist args;
--
Peter Stephenson <P.Stephenson@swansea.ac.uk> Tel: +44 1792 205678 extn. 4461
WWW: http://python.swan.ac.uk/~pypeters/ Fax: +44 1792 295324
Department of Physics, University of Wales, Swansea,
Singleton Park, Swansea, SA2 8PP, U.K.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-06-08 19:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <9504190520.AA12684@eggman.uucp>
1995-06-08 18:53 ` interrupting loops P.Stephenson
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).