[net.bugs.4bsd] 4.[12]bsd vi flubs early ^Z's

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

Index:	ucb/ex/ex.c Fix

Description:
	The "vi" command mishandles terminal stop signals received shortly
	after startup.

Repeat-By:
	Immediately after typing in the command
		vi /etc/passwd
	tap the Control and Z keys (or whatever keys you use to generate
	a "terminal stop" signal).  When you restart the editing session, note
	that the editor is
		"Using open mode"

Fix:
	Delay catching of the "terminal stop" signal.

	The deletion and addition below apply to the 4.1bsd version of "ex.c".
	Changes are bracketed with compilation directives conditioned on
	"OLDVERSION".  As usual, the trade secret status of the code involved
	precludes a clearer posting.

	First, remove the existing signal catch:

		#ifdef OLDVERSION
		#ifdef SIGTSTP
			if (!hush && signal(SIGTSTP, SIG_IGN) == SIG_DFL)
				signal(SIGTSTP, onsusp), dosusp++;
		#endif
		#endif

	And second, add the signal catch back in later in the code:

			.
			.
			.
		#ifndef OLDVERSION
		#ifdef SIGTSTP
			if (!hush && signal(SIGTSTP, SIG_IGN) == SIG_DFL)
				signal(SIGTSTP, onsusp), dosusp++;
		#endif
		#endif
			if (setexit() == 0 && !fast && intty)
			.
			.
			.
--
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