From: Mark Hanson <mark@acucobol.com>
To: zsh-workers@math.gatech.edu
Subject: TRAPZERR and interrupting loops
Date: Wed, 8 Nov 1995 10:08:33 -0800 [thread overview]
Message-ID: <199511081808.KAA05665@acucobol.acucobol.com> (raw)
I've had trouble for some time now with interrupting loops when
TRAPZERR is defined. I've finally taken the time to figure out what's
going on in the code to cause this.
It appears that when doshfunc() is called inside dotrap(), the variable
"breaks" is being reset and causing the loop to not end as it does
without TRAPZERR being set. I put code in to save the old value and
restore it after the call to doshfunc(), and it seems to work okay. I
have no idea what else it breaks, though. It would be good if someone
more familiar with this code could take a look.
To reproduce:
prompt% ./zsh -f
prompt% for x in 1 2 3 4 5; do
> echo $x
> sleep 1
> done
(hit ^C here and the loop will end)
prompt% TRAPZERR() { echo darn }
(run the same loop again, hit return, and the loop will not end)
Also, I noticed that lastval is defined as a long in globals.h, but it
is assigned to an int in signals.c/dotrap() (savval) and exec.c/doshfunc()
(oldlastval). I'm not sure if lastval should be an int or the others
should be longs.
All this is with 2.6-beta11 on SunOS 4.1.3.
Thanks,
Mark
reply other threads:[~1995-11-08 18:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199511081808.KAA05665@acucobol.acucobol.com \
--to=mark@acucobol.com \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).