aaec1fb
diff --git a/execute_cmd.c b/execute_cmd.c
aaec1fb
--- a/execute_cmd.c
aaec1fb
+++ b/execute_cmd.c
aaec1fb
@@ -3624,6 +3624,7 @@ execute_case_command (case_command)
aaec1fb
 	  free (pattern);
aaec1fb
 
aaec1fb
 	  dispose_words (es);
aaec1fb
+	  QUIT;
aaec1fb
 
aaec1fb
 	  if (match)
aaec1fb
 	    {
aaec1fb
diff --git a/patchlevel.h b/patchlevel.h
aaec1fb
--- a/patchlevel.h
aaec1fb
+++ b/patchlevel.h
aaec1fb
@@ -25,6 +25,6 @@
aaec1fb
    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
aaec1fb
    looks for to find the patch level (for the sccs version string). */
aaec1fb
 
aaec1fb
-#define PATCHLEVEL 13
aaec1fb
+#define PATCHLEVEL 14
aaec1fb
 
aaec1fb
 #endif /* _PATCHLEVEL_H_ */
aaec1fb
diff --git a/sig.c b/sig.c
aaec1fb
--- a/sig.c
aaec1fb
+++ b/sig.c
aaec1fb
@@ -94,6 +94,7 @@ static SigHandler *old_winch = (SigHandler *)SIG_DFL;
aaec1fb
 #endif
aaec1fb
 
aaec1fb
 static void initialize_shell_signals PARAMS((void));
aaec1fb
+static void kill_shell PARAMS((int));
aaec1fb
 
aaec1fb
 void
aaec1fb
 initialize_signals (reinit)
aaec1fb
@@ -486,6 +487,8 @@ restore_sigmask ()
aaec1fb
 #endif
aaec1fb
 }
aaec1fb
 
aaec1fb
+static int handling_termsig = 0;
aaec1fb
+
aaec1fb
 sighandler
aaec1fb
 termsig_sighandler (sig)
aaec1fb
      int sig;
aaec1fb
@@ -532,6 +535,14 @@ termsig_sighandler (sig)
aaec1fb
    sig == terminating_signal)
aaec1fb
     terminate_immediately = 1;
aaec1fb
 
aaec1fb
+  /* If we are currently handling a terminating signal, we have a couple of
aaec1fb
+     choices here. We can ignore this second terminating signal and let the
aaec1fb
+     shell exit from the first one, or we can exit immediately by killing
aaec1fb
+     the shell with this signal. This code implements the latter; to implement
aaec1fb
+     the former, replace the kill_shell(sig) with return. */
aaec1fb
+  if (handling_termsig)
aaec1fb
+    kill_shell (sig);		/* just short-circuit now */
aaec1fb
+
aaec1fb
   terminating_signal = sig;
aaec1fb
 
aaec1fb
   if (terminate_immediately)
aaec1fb
@@ -564,16 +575,13 @@ void
aaec1fb
 termsig_handler (sig)
aaec1fb
      int sig;
aaec1fb
 {
aaec1fb
-  static int handling_termsig = 0;
aaec1fb
-  int i, core;
aaec1fb
-  sigset_t mask;
aaec1fb
-
aaec1fb
   /* Simple semaphore to keep this function from being executed multiple
aaec1fb
      times.  Since we no longer are running as a signal handler, we don't
aaec1fb
      block multiple occurrences of the terminating signals while running. */
aaec1fb
   if (handling_termsig)
aaec1fb
     return;
aaec1fb
-  handling_termsig = 1;
aaec1fb
+
aaec1fb
+  handling_termsig = terminating_signal;	/* for termsig_sighandler */
aaec1fb
   terminating_signal = 0;	/* keep macro from re-testing true. */
aaec1fb
 
aaec1fb
   /* I don't believe this condition ever tests true. */
aaec1fb
@@ -613,6 +621,16 @@ termsig_handler (sig)
aaec1fb
 
aaec1fb
   run_exit_trap ();	/* XXX - run exit trap possibly in signal context? */
aaec1fb
 
aaec1fb
+  kill_shell (sig);
aaec1fb
+}
aaec1fb
+
aaec1fb
+static void
aaec1fb
+kill_shell (sig)
aaec1fb
+     int sig;
aaec1fb
+{
aaec1fb
+  int i, core;
aaec1fb
+  sigset_t mask;
aaec1fb
+
aaec1fb
   /* We don't change the set of blocked signals. If a user starts the shell
aaec1fb
      with a terminating signal blocked, we won't get here (and if by some
aaec1fb
      magic chance we do, we'll exit below). What we do is to restore the