From hsu@lelu.olari.bbnetworks.net  Tue Apr  9 08:25:27 2002
Return-Path: <hsu@lelu.olari.bbnetworks.net>
Received: from lelu.olari.bbnetworks.net (lelu.olari.bbnetworks.net [212.16.96.66])
	by hub.freebsd.org (Postfix) with ESMTP id E566137B41A
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Apr 2002 08:25:21 -0700 (PDT)
Received: (from root@localhost)
	by lelu.olari.bbnetworks.net (8.11.6/8.11.6) id g39FPwZ83311;
	Tue, 9 Apr 2002 18:25:58 +0300 (EEST)
	(envelope-from hsu)
Message-Id: <200204091525.g39FPwZ83311@lelu.olari.bbnetworks.net>
Date: Tue, 9 Apr 2002 18:25:58 +0300 (EEST)
From: Heikki Suonsivu <hsu@lelu.olari.bbnetworks.net>
Reply-To: Heikki Suonsivu <hsu@lelu.olari.bbnetworks.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: send-pr destroys PR if emacs interrupt character is used
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         36926
>Category:       gnu
>Synopsis:       [patch] send-pr destroys PR if emacs interrupt character is used
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bugmeister
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 09 08:30:02 PDT 2002
>Closed-Date:    Fri Jan 29 19:38:06 UTC 2010
>Last-Modified:  Fri Jan 29 19:38:06 UTC 2010
>Originator:     Heikki Suonsivu
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
bbnetworks.net
>Environment:
System: FreeBSD lelu.olari.bbnetworks.net 4.4-STABLE FreeBSD 4.4-STABLE #3: Thu Nov 29 07:07:25 EET 2001 hsu@lelu.olari.bbnetworks.net:/usr/obj/usr/src/sys/CAT i386

Console driver is pcvt.

>Description:

When editing a PR on console with emacs, send-pr seems to get a false
signal and aborts.
	
This has been around long, as I have seen this 3-4 years ago.  It is
very annoying because the PR is not saved anywhere and the situation
is often quite heated.  Every time this happens to me happens when
standing in computer room, having a nightmarish session fixing
something, and then writing a PR about whatever I run into, getting
'Aborted ...' and giving up.

# 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

>How-To-Repeat:

Go to console or unsetenv DISPLAY on xterm

	setenv EDITOR emacs
	send-pr

press  in emacs (emacs interrupt character)

exit from emacs normally

	and you get "Aborting ..." and your PR is lost.

This is repeatable.

>Fix:

Workaround for the problem would be leaving unfinished PR, if edited,
in the temporary file, so that a new send-pr can be invoked and
unfinished or unsent PR can be included into it.  I think send-pr
should not get mad on whatever interrupts the editor gets, anyway, and
destroying edited PR is usually undesirable, it should be saved
somwhere like mail saves a dead.letter.  dead.pr :-) ?

Probably should be submitted to gnats people also, but maybe first
figure out a proper fix.

--- /usr/bin/send-pr	Tue Mar 19 19:33:08 2002
+++ /tmp/send-pr-fixed	Tue Apr  9 18:08:44 2002
@@ -262,7 +262,7 @@
 # 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
+trap 'echo "$COMMAND: Aborting ..."; if cmp -s $REF $TEMP; then rm -f $REF $TEMP; else rm -f $REF; echo "Unfinished PR left in $TEMP"; fi; 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

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bugmeister 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Jan 26 01:17:28 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36926 
State-Changed-From-To: open->closed 
State-Changed-By: jh 
State-Changed-When: Fri Jan 29 19:35:06 UTC 2010 
State-Changed-Why:  
Duplicate of bin/59201. Fixed by r122587 and r135246. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36926 
>Unformatted:
