Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Apr 2002 18:25:58 +0300 (EEST)
From:      Heikki Suonsivu <hsu@lelu.olari.bbnetworks.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/36926: send-pr destroys PR if emacs interrupt character is used
Message-ID:  <200204091525.g39FPwZ83311@lelu.olari.bbnetworks.net>

next in thread | raw e-mail | index | archive | help

>Number:         36926
>Category:       bin
>Synopsis:       send-pr destroys PR if emacs interrupt character is used
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 09 08:30:02 PDT 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204091525.g39FPwZ83311>