Subject: pkg/19924: jove-4.16 is unusable on xterm -- upgraded to 4.16.0.58
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 01/19/2003 00:14:13
>Number:         19924
>Category:       pkg
>Synopsis:       jove-4.16 is unusable on xterm -- upgraded to 4.16.0.58
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 18 21:15:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Greg A. Woods
>Release:        pkgsrc-current 2002/01/17
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD 1.5W
Architecture: i386
Machine: i386
>Description:

	Jove 4.16 is unusable on NetBSD on some terminals, especially
	xterm, due to a problem in some of NetBSD's termcap entries, and
	fixing the termcap entries is not the best fix (though I may
	eventually get around to sending a PR with some of those fixes).

	From the README:

Changes since 4.16
------------------

- Portability fixes.  Most important: work around a never-to-be-fixed
  bug in ncurses (the freely redistributable termcap/terminfo
  database).

- Various minor bug fixes.  Highlights:
  + use mkstemp to avoid a security loophole
  + avoid bad interaction between metakey and xterm mouse support
    in windows wider than 95 characters
  + handle symlinks better
  + obscure bug in text justification that could hang JOVE
  + misuse of stat that only misbehaved on LINUX

>How-To-Repeat:

	try typing a space at the beginning of a line which already has
	multiple space separated words.

>Fix:

	upgrade to the most recent development release

	several improvements are included in the pkgsrc module are also
	included in this update.

cvs diff: Diffing editors/jove
Index: editors/jove/DESCR
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/editors/jove/DESCR,v
retrieving revision 1.1
diff -c -r1.1 DESCR
*** editors/jove/DESCR	31 Oct 2001 21:22:57 -0000	1.1
--- editors/jove/DESCR	18 Jan 2003 23:03:42 -0000
***************
*** 1,12 ****
! JOVE ("Jonathan's Own Version of Emacs") is an emacs-like editor less all
! the overhead of the LISP engine.  But for projects that don't require all
! the chrome of EMACS, JOVE will get the job done.  It supports split
! screens, shell windows, process control, customizable comment formatting
! and other features.  No syntax highlighting, colorisation or any of the
! other chrome.
  
! There is an 'X' version of jove included but it only works with SunTools
! or OpenWindows.  Hopefully this will be expanded.  It is not compiled in
! by default.
  
! If you want something more like EMACS, use EMACS.
--- 1,14 ----
! JOVE ("Jonathan's Own Version of Emacs") is an emacs-like editor.
! 
! JOVE is not extensible as it does not include a LISP engine, but this
! makes it small and very fast and thus ideal for normal text editing.
  
! JOVE is an advanced, easy-to-use, user-friendly environment for editing
! text, programs or anything else you may like to type.  It supports split
! screens, shell windows, process control, customizable comment formatting
! and other useful features.
  
! JOVE is designed to be run from a "dumb terminal", so it does not use
! the capabilities and conventions of windowing systems (multiple windows,
! mice, multiple fonts and so on).  JOVE can be run on such a system using
! a "terminal emulator" or "command window".
Index: editors/jove/MESSAGE
===================================================================
RCS file: editors/jove/MESSAGE
diff -N editors/jove/MESSAGE
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- editors/jove/MESSAGE	18 Jan 2003 23:56:52 -0000
***************
*** 0 ****
--- 1,5 ----
+ In order to safely preserve temporary files holding modified buffers
+ after a crash (system crash or jove crash) you should add the following
+ line to both /etc/rc.local and /etc/daily.local:
+ 
+ 	${PREFIX}/lib/jove/recover -crash-preserve
Index: editors/jove/Makefile
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/editors/jove/Makefile,v
retrieving revision 1.2
diff -c -r1.2 Makefile
*** editors/jove/Makefile	16 Feb 2001 14:40:50 -0000	1.2
--- editors/jove/Makefile	18 Jan 2003 23:57:17 -0000
***************
*** 1,15 ****
  # $NetBSD: Makefile,v 1.2 2001/02/16 14:40:50 wiz Exp $
  #
  
! DISTNAME=	jove-4.16
  CATEGORIES=	editors
! MASTER_SITES=	ftp://ftp.cs.toronto.edu/pub/moraes/jove/
  
  MAINTAINER=	packages@netbsd.org
! COMMENT=	small emacs-style editor, but lacks the LISP engine
  
! WRKSRC=		${WRKDIR}/jove
  
  NO_CONFIGURE=	yes
  
  .include "../../mk/bsd.pkg.mk"
--- 1,21 ----
  # $NetBSD: Makefile,v 1.2 2001/02/16 14:40:50 wiz Exp $
  #
  
! PKGNAME=	jove-${JOVE_VERSION}
! DISTNAME=	jove${JOVE_VERSION}
! EXTRACT_SUFX=	.tgz
  CATEGORIES=	editors
! MASTER_SITES=	ftp://ftp.cs.toronto.edu/pub/hugh/jove-dev/
  
  MAINTAINER=	packages@netbsd.org
! COMMENT=	small emacs-style editor, but without the LISP engine
  
! JOVE_VERSION=	4.16.0.58
! 
! WRKSRC=		${WRKDIR}
  
  NO_CONFIGURE=	yes
+ 
+ ALL_TARGET=	all doc/jove.man doc/jove.man.ps
  
  .include "../../mk/bsd.pkg.mk"
Index: editors/jove/PLIST
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/editors/jove/PLIST,v
retrieving revision 1.1
diff -c -r1.1 PLIST
*** editors/jove/PLIST	31 Oct 2001 21:22:57 -0000	1.1
--- editors/jove/PLIST	19 Jan 2003 00:09:02 -0000
***************
*** 1,8 ****
  @comment $NetBSD: PLIST,v 1.1 2001/10/31 21:22:57 zuntum Exp $
  bin/jove
  bin/teachjove
- lib/jove/portsrv
  lib/jove/recover
  share/jove/XTermresource
  share/jove/cmds.doc
  share/jove/jove.rc
--- 1,11 ----
  @comment $NetBSD: PLIST,v 1.1 2001/10/31 21:22:57 zuntum Exp $
  bin/jove
  bin/teachjove
  lib/jove/recover
+ share/doc/jove/README
+ share/doc/jove/jove.man
+ share/doc/jove/jove.man.ps
+ share/doc/jove/jove.qref
  share/jove/XTermresource
  share/jove/cmds.doc
  share/jove/jove.rc
***************
*** 23,28 ****
  share/jove/keychart.z29
  share/jove/teach-jove
  man/man1/jove.1
- man/man1/jovetool.1
  man/man1/teachjove.1
! man/man1/xjove.1
--- 26,32 ----
  share/jove/keychart.z29
  share/jove/teach-jove
  man/man1/jove.1
  man/man1/teachjove.1
! @dirrm lib/jove
! @dirrm share/doc/jove
! @dirrm share/jove
Index: editors/jove/distinfo
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/editors/jove/distinfo,v
retrieving revision 1.2
diff -c -r1.2 distinfo
*** editors/jove/distinfo	19 Apr 2001 11:01:02 -0000	1.2
--- editors/jove/distinfo	19 Jan 2003 00:05:58 -0000
***************
*** 1,7 ****
  $NetBSD: distinfo,v 1.2 2001/04/19 11:01:02 agc Exp $
  
! SHA1 (jove-4.16.tar.gz) = 47272816abac0c4b7b9e41a89d390d06a988cfcb
! Size (jove-4.16.tar.gz) = 432274 bytes
! SHA1 (patch-aa) = 51592f10aaaf5de234d50bf154484463163a30c6
! SHA1 (patch-ab) = 9c63b0208ff1a84dc7f015841d8f19968cef6d01
  SHA1 (patch-ac) = 98329cfcbbec9d56cbef7e1bee6685b6dd25e8ac
--- 1,7 ----
  $NetBSD: distinfo,v 1.2 2001/04/19 11:01:02 agc Exp $
  
! SHA1 (jove4.16.0.58.tgz) = f597c2b6206f7614039cec5b2cd56313a3b577c8
! Size (jove4.16.0.58.tgz) = 447828 bytes
! SHA1 (patch-aa) = eae6aa08c156d96f6a9fc7ca5ec76c636459c0f9
! SHA1 (patch-ab) = 5b4c6229029ecd7e6b6e4abbf0c13e0e424dafb2
  SHA1 (patch-ac) = 98329cfcbbec9d56cbef7e1bee6685b6dd25e8ac
cvs diff: Diffing editors/jove/patches
Index: editors/jove/patches/patch-aa
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/editors/jove/patches/patch-aa,v
retrieving revision 1.2
diff -c -r1.2 patch-aa
*** editors/jove/patches/patch-aa	19 Jan 2000 16:32:13 -0000	1.2
--- editors/jove/patches/patch-aa	18 Jan 2003 23:21:33 -0000
***************
*** 1,16 ****
  $NetBSD: patch-aa,v 1.2 2000/01/19 16:32:13 agc Exp $
  
! --- Makefile.orig	Tue Mar 19 04:44:33 1996
! +++ Makefile	Wed Jan 19 16:25:36 2000
! @@ -27,16 +27,20 @@
   # LIBDIR and SHAREDIR.  All others must already exist.
   
-  SHELL = /bin/sh
- -TMPDIR = /usr/tmp
- -RECDIR = /usr/preserve
- +TMPDIR = /var/tmp
- +RECDIR = /var/preserve
-  
  +.if defined(LOCALBASE)
  +JOVEHOME = $(LOCALBASE)
  +.else
--- 1,11 ----
  $NetBSD: patch-aa,v 1.2 2000/01/19 16:32:13 agc Exp $
  
! --- Makefile.orig	Wed Mar 20 16:48:00 2002
! +++ Makefile	Sat Jan 18 18:19:44 2003
! @@ -21,11 +21,16 @@
!  # If they don't exist, this makefile will try to create the directories
   # LIBDIR and SHAREDIR.  All others must already exist.
   
  +.if defined(LOCALBASE)
  +JOVEHOME = $(LOCALBASE)
  +.else
***************
*** 20,33 ****
  +SHAREDIR = $(JOVEHOME)/share/jove
   LIBDIR = $(JOVEHOME)/lib/jove
   BINDIR = $(JOVEHOME)/bin
   MANDIR = $(JOVEHOME)/man/man$(MANEXT)
   MANEXT = 1
  -DFLTSHELL = /bin/csh
  +DFLTSHELL = /bin/sh
   
   # The install commands of BSD and System V differ in unpleasant ways:
   # -c: copy (BSD); -c dir: destination directory (SysV)
! @@ -47,15 +51,15 @@
   # "cp" will work reasonably well, but be aware that any links continue
   # referencing the old file with new contents.
   
--- 15,40 ----
  +SHAREDIR = $(JOVEHOME)/share/jove
   LIBDIR = $(JOVEHOME)/lib/jove
   BINDIR = $(JOVEHOME)/bin
+  XEXT=
+ +DOCDIR = $(JOVEHOME)/share/doc/jove
   MANDIR = $(JOVEHOME)/man/man$(MANEXT)
   MANEXT = 1
+  
+ @@ -38,11 +43,11 @@
+  # (in case the system startup salvages tempfiles by moving them,
+  # which is probably a good idea).
+  
+ -TMPDIR = /tmp
+ +TMPDIR = /var/tmp
+  RECDIR = /var/preserve
+  
+  # DFLTSHELL is the default shell invoked by JOVE and TEACHJOVE.
  -DFLTSHELL = /bin/csh
  +DFLTSHELL = /bin/sh
   
   # The install commands of BSD and System V differ in unpleasant ways:
   # -c: copy (BSD); -c dir: destination directory (SysV)
! @@ -53,17 +58,19 @@
   # "cp" will work reasonably well, but be aware that any links continue
   # referencing the old file with new contents.
   
***************
*** 35,76 ****
  +INSTALLFLAGS = -g wheel -o root
   
   # to install executable files
! -XINSTALL=cp
! -#XINSTALL=/usr/ucb/install $(INSTALLFLAGS) -c -m 755 # -s
! +#XINSTALL=cp
  +XINSTALL=${BSD_INSTALL_PROGRAM}
   
   # to install text files
! -TINSTALL=cp
! -#TINSTALL=/usr/ucb/install $(INSTALLFLAGS) -c -m 644
! +#TINSTALL=cp
  +TINSTALL=${BSD_INSTALL_DATA}
   
   # These should all just be right if the above ones are.
   # You will confuse JOVE if you move anything from LIBDIR or SHAREDIR.
! @@ -79,7 +83,7 @@
!  # compiler, adding -Xa -v will increase compiler checking.
!  # On DEC OSF/1, -std1 -O
   
  -OPTFLAGS = -O
! +OPTFLAGS = -O2
   
   # For making dependencies under BSD systems
   DEPENDFLAG = -M
! @@ -163,7 +167,7 @@
!  #
!  # You can just say 'make SYSDEFS=-Dwhatever' on these systems.
   
! -SYSDEFS =
! +SYSDEFS = -DBSDPOSIX
   
   # for SCO Xenix, set
   #	MEMFLAGS = -Mle
! @@ -179,6 +183,7 @@
!  # CC = /opt/SUNWspro/bin/cc
!  # For DG AViiON, expect compile errors unless you use the GNU C compiler:
!  # CC=gcc
! +CC= gcc
   
!  # Load invocation of cc.
!  # LDCC = purify $(CC)
--- 42,188 ----
  +INSTALLFLAGS = -g wheel -o root
   
   # to install executable files
!  XINSTALL=cp
!  #XINSTALL=/usr/ucb/install $(INSTALLFLAGS) -c -m 755 # -s
!  #CYGWIN32: XINSTALL=install $(INSTALLFLAGS) -c -m 755
  +XINSTALL=${BSD_INSTALL_PROGRAM}
   
   # to install text files
!  TINSTALL=cp
!  #TINSTALL=/usr/ucb/install $(INSTALLFLAGS) -c -m 644
!  #CYGWIN32: TINSTALL=install $(INSTALLFLAGS) -c -m 644
  +TINSTALL=${BSD_INSTALL_DATA}
   
   # These should all just be right if the above ones are.
   # You will confuse JOVE if you move anything from LIBDIR or SHAREDIR.
! @@ -72,6 +79,11 @@
!  TEACHJOVE = $(BINDIR)/teachjove$(XEXT)
!  RECOVER = $(LIBDIR)/recover$(XEXT)
!  PORTSRV = $(LIBDIR)/portsrv$(XEXT)
! +JOVEEXRC = $(DOCDIR)/example.rc
! +JOVEMAN = $(DOCDIR)/jove.man
! +JOVEMANPS = $(DOCDIR)/jove.man.ps
! +JOVEREADME = $(DOCDIR)/README
! +JOVEQREF = $(DOCDIR)/jove.qref
!  JOVERC = $(SHAREDIR)/jove.rc
!  TERMSDIR = $(SHAREDIR)
!  CMDS.DOC = $(SHAREDIR)/cmds.doc
! @@ -137,7 +149,7 @@
!  # Add -DUSE_EXIT if you're profiling or using purify (this causes Jove
!  # to exit using exit(), instead of _exit()).
!  
! -SYSDEFS = -DBSDPOSIX
! +SYSDEFS = -DBSDPOSIX -DUSE_OPENPTY
!  
!  # Select optimization level (flags passed to compiling and linking steps).
!  # On most systems: -g for debugging, -O for optimization.
! @@ -146,7 +158,7 @@
!  # On DEC OSF/1 and Digital UNIX VV4.0, add -std1 to enable ANSI C features
!  # and perhaps -g3 for more debugging info with optimization.
   
  -OPTFLAGS = -O
! +#OPTFLAGS = -O
   
   # For making dependencies under BSD systems
   DEPENDFLAG = -M
! @@ -168,7 +180,7 @@
!  #	FreeBSD 4.2: EXTRALIBS = -lutil
!  #	FreeBSD 4.2, NetBSD 1.5, OpenBSD 2.x:  EXTRALIBS = -lutil
!  
! -EXTRALIBS =
! +EXTRALIBS = -lutil
!  
!  # Flags of linker (LDFLAGS)
!  # Most systems do not need any flags.
! @@ -181,13 +193,13 @@
!  #	PDP-11 with separate I&D: -i
!  #	PDP-11 without separate I&D: -n
   
! -LDFLAGS =
! +#LDFLAGS =
   
   # for SCO Xenix, set
   #	MEMFLAGS = -Mle
!  #	CFLAGS = -LARGE -O -F 3000 -K -Mle  (say -Mle2 for an 80286)
!  
! -CFLAGS = $(OPTFLAGS) $(SYSDEFS)
! +CFLAGS += $(SYSDEFS)
!  
!  # For SYSVR4 (/usr/ucb/cc will NOT work because of setjmp.h):
!  #	CC = /usr/bin/cc
! @@ -233,9 +245,11 @@
!  #	TROFFPOST =
!  NROFF = nroff
!  TROFF = troff -Tpost
! +TROFF = groff
!  TROFFPOST = | /usr/lib/lp/postscript/dpost -
! +TROFFPOST = 
!  
! -MANUALS = $(JOVEM) $(TEACHJOVEM) $(XJOVEM) $(JOVETOOLM)
! +MANUALS = $(JOVEM) $(TEACHJOVEM) $(JOVEREADME) $(JOVEQREF) $(JOVEMAN) $(JOVEMANPS)
!  
!  C_SRC = commands.c commands.tab abbrev.c argcount.c ask.c buf.c c.c case.c jctype.c \
!  	delete.c disp.c extend.c fp.c fmt.c insert.c io.c iproc.c \
! @@ -267,7 +281,7 @@
!  
!  DOCS =	doc/README doc/teach-jove doc/jove.qref \
!  	doc/intro.nr doc/cmds.macros.nr doc/cmds.nr doc/contents.nr \
! -	doc/jove.nr doc/teachjove.nr doc/xjove.nr doc/jovetool.nr \
! +	doc/jove.nr doc/teachjove.nr \
!  	doc/jove.rc doc/example.rc $(DOCTERMS)
!  
!  MISC =	Makefile Makefile.bcc Makefile.msc Makefile.wat Makefile.zor \
! @@ -281,9 +295,8 @@
!  
!  # all: default target.
!  # Builds everything that "install" needs.
! -all:	jjove$(XEXT) recover$(XEXT) teachjove$(XEXT) portsrv$(XEXT) \
! -	doc/cmds.doc doc/jove.$(MANEXT) doc/teachjove.$(MANEXT) \
! -	doc/jovetool.$(MANEXT)
! +all:	jjove$(XEXT) recover$(XEXT) teachjove$(XEXT) \
! +	doc/cmds.doc doc/jove.$(MANEXT) doc/teachjove.$(MANEXT)
!  
!  jjove$(XEXT):	$(OBJECTS)
!  	$(LDCC) $(LDFLAGS) $(OPTFLAGS) -o jjove$(XEXT) $(OBJECTS) $(TERMCAPLIB) $(EXTRALIBS)
! @@ -356,13 +369,16 @@
!  # Thus, if "all" is done first, "install" can be invoked with
!  # JOVEHOME pointing at a playpen where files are to be marshalled.
!  # This property is fragile.
! -install: $(LIBDIR) $(SHAREDIR) \
! +install: $(DOCDIR) $(LIBDIR) $(SHAREDIR) \
!  	 $(TEACH-JOVE) $(CMDS.DOC) $(TERMSDIR)docs \
!  	 $(PORTSRVINST) $(RECOVER) $(JOVE) $(TEACHJOVE) $(MANUALS)
!  	$(TINSTALL) doc/jove.rc $(JOVERC)
!  	@echo See the README about changes to /etc/rc or /etc/rc.local
!  	@echo so that the system recovers jove files on reboot after a crash
!  
! +$(DOCDIR)::
! +	test -d $(DOCDIR) || mkdir $(DOCDIR)
! +
!  $(LIBDIR)::
!  	test -d $(LIBDIR) || mkdir $(LIBDIR)
!  
! @@ -384,8 +400,23 @@
!  $(CMDS.DOC): doc/cmds.doc
!  	$(TINSTALL) doc/cmds.doc $(CMDS.DOC)
!  
! +$(JOVEEXRC): doc/example.rc
! +	$(TINSTALL) doc/example.rc $(JOVEExRC)
! +
! +$(JOVEMAN): doc/jove.man
! +	$(TINSTALL) doc/jove.man $(JOVEMAN)
! +
! +$(JOVEMANPS): doc/jove.man.ps
! +	$(TINSTALL) doc/jove.man.ps $(JOVEMANPS)
! +
!  $(JOVERC): doc/jove.rc
!  	$(TINSTALL) doc/jove.rc $(JOVERC)
! +
! +$(JOVEREADME): doc/README
! +	$(TINSTALL) doc/README $(JOVEREADME)
! +
! +$(JOVEQREF): doc/jove.qref
! +	$(TINSTALL) doc/jove.qref $(JOVEQREF)
   
!  $(TERMSDIR)docs: $(DOCTERMS)
!  	$(TINSTALL) $(DOCTERMS) $(TERMSDIR)
Index: editors/jove/patches/patch-ab
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/editors/jove/patches/patch-ab,v
retrieving revision 1.1
diff -c -r1.1 patch-ab
*** editors/jove/patches/patch-ab	27 Sep 1999 18:21:59 -0000	1.1
--- editors/jove/patches/patch-ab	18 Jan 2003 23:59:54 -0000
***************
*** 1,12 ****
! $NetBSD: patch-ab,v 1.1 1999/09/27 18:21:59 kim Exp $
  
! --- sysdep.h.orig	Mon Mar 18 23:44:33 1996
! +++ sysdep.h	Mon Sep 27 14:18:52 1999
! @@ -154,6 +154,7 @@
!  # define USE_FSYNC	1
!  # define USE_FSTAT	1
!  # define USE_FCHMOD	1
! +# define USE_CTYPE	1
   #endif
   
!  #ifdef IRIX
--- 1,158 ----
! #ident "@(#)$NetBSD$"
  
! --- recover.c.orig	Wed Mar 20 16:49:39 2002
! +++ recover.c	Sat Jan 18 18:59:11 2003
! @@ -6,11 +6,14 @@
!   **************************************************************************/
!  
!  /* Recovers JOVE files after a system/editor crash.
! - * Usage: recover [-d directory] [-syscrash]
! - * The -syscrash option is specified in /etc/rc.  It directs recover to
! - * move all the jove tmp files from tmp_dir (/tmp) to RECDIR (/usr/preserve).
! - * recover -syscrash must be invoked in /etc/rc BEFORE /tmp gets cleared out.
! - * (about the same place as expreserve gets invoked to save ed/vi/ex files.
! + *
! + * Usage: recover [-d directory] [-crash-preserve]
! + *
! + * The -crash-preserve option is used in /etc/rc and /etc/daily.  It directs
! + * recover to move all the jove tmp files from tmp_dir (/var/tmp) to RECDIR
! + * (/var/preserve).  "recover -crash-preserve" must be invoked in /etc/rc
! + * BEFORE tmp_dir gets cleared out, if it does (i.e. at about the same place as
! + * expreserve gets invoked to save ed/vi/ex files).
!   *
!   * The -d option lets you specify the directory to search for tmp files when
!   * the default isn't the right one.
! @@ -87,6 +90,10 @@
!  # define L_INCR	1
   #endif
   
! +#ifndef SENDMAIL_CMD
! +# define SENDMAIL_CMD	"/usr/sbin/sendmail -t"
! +#endif
! +
!  private char	blk_buf[JBUFSIZ];
!  private int	nleft;
!  private FILE	*ptrs_fp;
! @@ -744,9 +751,7 @@
!  MailUser(rec)
!  struct rec_head *rec;
!  {
! -	char mail_cmd[BUFSIZ];
!  	char *last_update;
! -	const char *buf_string;
!  	FILE *mail_pipe;
!  	struct passwd *pw;
!  
! @@ -755,28 +760,23 @@
!  
!  	last_update = ctime(&(rec->UpdTime));
!  	/* Start up mail */
! -	sprintf(mail_cmd, "/bin/mail %s", pw->pw_name);
!  	setuid(getuid());
! -	if ((mail_pipe = popen(mail_cmd, "w")) == NULL)
! +	if ((mail_pipe = popen(SENDMAIL_CMD, "w")) == NULL)
!  		return;
!  
! -	setbuf(mail_pipe, mail_cmd);
! -	/* Let's be grammatically correct! */
! -	if (rec->Nbuffers == 1)
! -		buf_string = "buffer";
! -	else
! -		buf_string = "buffers";
! -	fprintf(mail_pipe, "Subject: System crash\n");
! +	fprintf(mail_pipe, "To: %s\n", pw->pw_name);
! +	fprintf(mail_pipe, "Subject: %d buffer%s saved when the jove on %s crashed.\n",
! +	 rec->Nbuffers, rec->Nbuffers ? "s" : "", hname());
!  	fprintf(mail_pipe, " \n");
! -	fprintf(mail_pipe, "Jove saved %d %s when the system \"%s\"\n",
! -	 rec->Nbuffers, buf_string, hname());
! -	fprintf(mail_pipe, "crashed on %s\n\n", last_update);
! -	fprintf(mail_pipe, "You can retrieve the %s using Jove's -r\n",
! -	 buf_string);
! +	fprintf(mail_pipe, "Jove saved %d modified buffer%s on the system \"%s\"\n",
! +	 rec->Nbuffers, rec->Nbuffers ? "s" : "", hname());
! +	fprintf(mail_pipe, "when it crashed on %s\n\n", last_update); /* intentionally vague "it" */
! +	fprintf(mail_pipe, "You can retrieve the buffer%s using Jove's -r\n",
! +	 rec->Nbuffers ? "s" : "");
!  	fprintf(mail_pipe, "(recover option) i.e. give the command.\n");
!  	fprintf(mail_pipe, "\tjove -r\n");
! -	fprintf(mail_pipe, "See the Jove manual for more details\n");
! -	pclose(mail_pipe);
! +	fprintf(mail_pipe, "See the Jove manual for more details\n\n");
! +	(void) pclose(mail_pipe);
!  }
!  
!  
! @@ -798,33 +798,38 @@
!  	get_files(tmp_dir);
!  	for (fp = First; fp != NULL; fp = fp->file_next) {
!  		if (stat(fp->file_data, &stbuf) < 0) {
! -			perror("recover: stat failed.");
! +			perror("recover: stat failed");
!  			continue;
!  		}
!  		switch (pid = fork()) {
!  		case -1:
! -			fprintf(stderr, "recover: can't fork\n!");
! +			perror("recover: can't fork");
!  			exit(-1);
!  			/*NOTREACHED*/
!  
!  		case 0:
! -			fprintf(stderr, "Recovering: %s, %s\n", fp->file_data,
! -			 fp->file_rec);
! -			if ((fd = open(fp->file_rec, O_RDONLY | O_BINARY)) != -1) {
! -				if ((read(fd, (UnivPtr) &header, sizeof header) != sizeof header)) {
! -					close(fd);
! -					return;
! -				} else
! -					close(fd);
! +			/* CHILD: */
! +			if ((fd = open(fp->file_rec, O_RDONLY | O_BINARY)) == -1)
! +				exit(1);
! +			if ((read(fd, (UnivPtr) &header, sizeof header) != sizeof header)) {
! +				(void) close(fd);
! +				exit(2);
!  			}
! +			(void) close(fd);
! +			/* Ask about JOVE's that are still running ... */
! +			if (kill(header.Pid, 0) == 0)
! +				exit(0);
! +			fprintf(stderr, "Recovering: %s, %s\n", fp->file_data,
! +				fp->file_rec);
!  			MailUser(&header);
!  			execl("/bin/mv", "mv", fp->file_data, fp->file_rec,
! -				  RecDir, (char *)NULL);
! -			fprintf(stderr, "recover: cannot execl /bin/mv.\n");
! -			exit(-1);
! +			      RecDir, (char *)NULL);
! +			perror("recover: cannot execl /bin/mv");
! +			exit(3);
!  			/*NOTREACHED*/
!  
!  		default:
! +			/* PARENT: */
!  			do ; while (wait(&status) != pid);
!  			if (WIFSIGNALED(status))
!  				fprintf(stderr, "recover: copy terminated by signal %d\n.\n", WTERMSIG(status));
! @@ -882,9 +887,9 @@
!  	}
!  
!  	if (scanvec(argv, "-help")) {
! -		printf("recover: usage: recover [-d directory] [-syscrash]\n\n");
! +		printf("recover: usage: recover [-d directory] [-crash-preserve]\n\n");
!  		printf("Use \"jove -r\" after JOVE has died for some unknown reason.\n\n");
! -		printf("Use \"%s/recover -syscrash\"\n", LIBDIR);
! +		printf("Use \"%s/recover -crash-preserve\"\n", LIBDIR);
!  		printf("\twhen the system is in the process of rebooting.\n");
!  		printf("\tThis is done automatically at reboot time and\n");
!  		printf("\tso most of you don't have to worry about that.\n\n");
! @@ -897,7 +902,7 @@
!  		Verbose = YES;
!  	if ((argvp = scanvec(argv, "-d")) != NULL)
!  		tmp_dir = argvp[1];
! -	if (scanvec(argv, "-syscrash")) {
! +	if (scanvec(argv, "-crash-preserve")) {
!  		printf("Recovering jove files ... ");
!  		savetmps();
!  		printf("Done.\n");
>Release-Note:
>Audit-Trail:
>Unformatted: