[net.bugs.4bsd] 4.?BSD vi sends incorrect mail

ado@elsie.UUCP (Arthur David Olson) (01/22/86)

Index:	ucb/ex/expreserve.c Fix

Description:
	When a "vi" session ends unexpectedly and a name has yet to be
	assigned to the file being edited, incorrect mail is sent to the
	user.

Repeat-By:
	Type in the command
		vi
	and use the 'a' command to add some text,
	then suspend the job and "kill -HUP" it.
	Note the contents of the letter you receive:

    A copy of an editor buffer of yours was saved when the editor was killed.
    No name was associated with this buffer so it has been named "LOST".
    This buffer can be retrieved using the "recover" command of the editor.
    An easy way to do this is to give the command "ex -r ".
    This works for "edit" and "vi" also.

	In the fourth line of the letter, the quoted "ex -r " should be
	"ex -r LOST".

Fix:
	This is the fix to "expreserve.c".  While we're in the neighborhood,
	we'll also make the code a bit more modest.  As usual, the trade
	secret status of the code involved precludes a clearer posting.
	Changes are conditioned on "OLDVERSION".

    .
    .
    .
    "No name was associated with this buffer so it has been named \"LOST\".\n");
    #ifndef OLDVERSION
    		fname = "LOST";
    #endif /* !OLDVERSION */
    .
    .
    .
    #ifdef OLDVERSION
    "An easy way to do this is to give the command \"ex -r %s\".\n",fname);
    #else /* !OLDVERSION */
    "One way to do this is to give the command \"ex -r %s\".\n",fname);
    #endif /* !OLDVERSION */
    .
    .
    .
--
Ex is an Elizabeth Taylor trademark.
--
	UUCP: ..decvax!seismo!elsie!ado    ARPA: elsie!ado@seismo.ARPA
	DEC, VAX and Elsie are Digital Equipment and Borden trademarks