4.[12]bsd vi flubs early ^Z's (with fix)

Arthur David Olson ado at elsie.UUCP
Tue Jan 28 07:05:33 AEST 1986


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 at seismo.ARPA
	DEC, VAX and Elsie are Digital Equipment and Borden trademarks



More information about the Comp.bugs.4bsd.ucb-fixes mailing list