Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: subtle `echo' bug
- X-seq: zsh-workers 21386
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: subtle `echo' bug
- Date: Mon, 27 Jun 2005 11:03:01 +0100
- In-reply-to: <1050615163946.ZM10520@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20050614172738.GL4685@xxxxxxxxxxxxxxxxxxx> <200506142212.24133.arvidjaar@xxxxxxxxxx> <1050615002844.ZM7767@xxxxxxxxxxxxxxxxxxxxxxx> <200506150910.j5F9AEFa009630@xxxxxxxxxxxxxx> <200506151356.j5FDunra015702@xxxxxxxxxxxxxx> <1050615153214.ZM10443@xxxxxxxxxxxxxxxxxxxxxxx> <200506151549.j5FFn94K018908@xxxxxxxxxxxxxx> <1050615163946.ZM10520@xxxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
> Since this only affects interactive shells, we could consider breaking
> the loop only on SIGINT and SIGQUIT (that is, on keyboard-generated
> signals). As is the loop ends on e.g. SIGSEGV, or any other process-
> killing signal that hits a child.
Are we going to do this?
Index: Src/jobs.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/jobs.c,v
retrieving revision 1.39
diff -u -r1.39 jobs.c
--- Src/jobs.c 1 Jun 2005 10:45:42 -0000 1.39
+++ Src/jobs.c 27 Jun 2005 10:01:24 -0000
@@ -383,7 +383,8 @@
}
/* If we have `foo|while true; (( x++ )); done', and hit
* ^C, we have to stop the loop, too. */
- if ((val & 0200) && inforeground == 1) {
+ if ((val & 0200) && inforeground == 1 &&
+ (WTERMSIG(val) == SIGINT || WTERMSIG(val) == SIGQUIT)) {
if (!errbrk_saved) {
errbrk_saved = 1;
prev_breaks = breaks;
@@ -399,7 +400,8 @@
adjustwinsize(0);
}
}
- } else if (list_pipe && (val & 0200) && inforeground == 1) {
+ } else if (list_pipe && (val & 0200) && inforeground == 1 &&
+ (WTERMSIG(val) == SIGINT || WTERMSIG(val) == SIGQUIT)) {
if (!errbrk_saved) {
errbrk_saved = 1;
prev_breaks = breaks;
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author