Subject: bin/2530: send-pr traps SIGINT while in your editor
To: None <gnats-bugs@NetBSD.ORG>
From: John Hawkinson <jhawk@mit.edu>
List: netbsd-bugs
Date: 06/08/1996 18:11:22
>Number:         2530
>Category:       bin
>Synopsis:       send-pr traps SIGINT while in your editor
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jun  8 18:20:01 1996
>Last-Modified:
>Originator:     John Hawkinson
>Organization:
MIT SIPB
>Release:        1.2_ALPHA
>Environment:
	
System: NetBSD lola-granola 1.1B NetBSD 1.1B (LOLA) #8: Fri Apr 19 11:03:57 EDT 1996 mycroft@zygorthian-space-raiders:/afs/sipb.mit.edu/project/netbsd/dev/current-source/build/i386_nbsd1/sys/arch/i386/compile/LOLA i386


>Description:
	If you hit a ^C while in your editor started from send-pr,
	send-pr catches the signal after you exit the editor and
	aborts your PR.

	This is really annoying if you've just spent 10 minutes writing
	up a detailed PR and then lose your work because you accidently
	hit ^C while in vi.
>How-To-Repeat:
	Run send-pr with vi as your $EDITOR. Hit ^C. Hit :wq. Observe
	"aborting..."
>Fix:
	Untrap SIGINT before running your editor:


*** send-pr.sh.dist	Sat Jun  8 18:04:11 1996
--- send-pr.sh	Sat Jun  8 18:06:57 1996
***************
*** 259,265 ****
  # Catch some signals. ($xs kludge needed by Sun /bin/sh)
  xs=0
  trap 'rm -f $REF $TEMP; exit $xs' 0
! trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit' 1 2 3 13 15
  
  # If they told us to use a specific file, then do so.
  if [ -n "$IN_FILE" ]; then
--- 259,266 ----
  # Catch some signals. ($xs kludge needed by Sun /bin/sh)
  xs=0
  trap 'rm -f $REF $TEMP; exit $xs' 0
! TRAPACTION='echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit'
! trap "$TRAPACTION" 1 2 3 13 15
  
  # If they told us to use a specific file, then do so.
  if [ -n "$IN_FILE" ]; then
***************
*** 359,365 ****
--- 360,368 ----
  
    chmod u+w $TEMP
    if [ -z "$REQUEST_ID" ]; then
+     trap 2
      eval $EDIT $TEMP
+     trap "$TRAPACTION" 2
    else
      ed -s $TEMP << '__EOF__'
  /^Subject/s/^Subject:.*/Subject: request for a customer id/
***************
*** 485,491 ****
--- 488,496 ----
  	xs=1; exit
  	;;
        e*)
+         trap 2
          eval $EDIT $TEMP
+         trap "$TRAPACTION" 2
  	continue 2
  	;;
        s*)
>Audit-Trail:
>Unformatted: