Subject: bug fix for bash-1.12 available
From: [email-masked] (Rick Sladkey)
Date: 2 May 1993 10:53:36 +0300
Newsgroups: comp.os.linux.announce

I have uploaded a fixed version of bash-1.12 for Linux to
sunsite.unc.edu.  The file for now is:

* sunsite.unc.edu:/pub/Linux/Incoming/bash-1.12-fixed.tar.z

This gzipped file contains Linux patches against bash-1.12 and a
static binary for Linux.

This distribution fixes the oft cited bug where shelling out to an
editor (emacs, elvis, vile) from any program followed by an interrupt
character causes both programs to fight for input.  We get several
messages per week on comp.os.linux asking if this is a kernel bug.  It
is not a kernel bug.

In fact, it is due to a buglet in bash that causes bash to die when it
is run non-interactively as the parent of a program that catches
SIGINT without exiting.  For example, if you shell out to emacs from,
say, elm or trn, and type `^G' all hell breaks loose and you have to
kill both programs.

Since bash is my favorite shell, and since this is very disabling bug
for those who frequently run into it, and since we get so many bug
reports on c.o.l, I decided to take a stab at fixing it. I do not
promise my fix is elegant, complete, or even correct.  But it does
work around this most common problem, seemingly without breaking
anything else.

This fix also works for other platforms than Linux where bash also
shows this bug.  Until bash-1.13 comes along (which corrects this
problem) this may have to do.  The fix is quite simple and is appended
here.

Rick Sladkey <[email-masked]>
-----
*** orig/bash-1.12/jobs.c	Fri Jan 17 16:36:11 1992
--- bash-1.12/jobs.c		Sat May  1 15:00:03 1993
***************
*** 1251,1256 ****
--- 1253,1263 ----
        sigset_t set;
  
        sigemptyset (&set);
+       if (!interactive)
+ 	{
+ 	  sigaddset(&set, SIGINT);	
+ 	  sigaddset(&set, SIGQUIT);	
+ 	}
        sigsuspend (&set);
  #else /* SCO Unix */
        struct sigaction act, oact;