Subject: vi display/file corruption and/or crash when window is resized.
Index:	 src/ucb/ex/ex_v.c

Description:
	Install patch 484 which adds support for window size change option
	in telnetd.   Changing the size of the window will cause the file (and
	display) to be corrupted.  
	
Repeat-By:
	telnet into (rlogin can also be used if available) the 2.11 system
	with #484 applied.
	
	Invoke vi on a file.  Change the window size.  Note now the display
	becomes garbled.  Saving the file will produce a corrupt file (so
	use a junk file or save to a different name)

	Eventually vi will crash giving a core file with invalid stack frame 
	pointer.
Fix:
	Blocking the window size change signal (SIGWINCH) around one critical
	spot fixes the problem.  MANY thanks to martin@teckelworks.com for
	wrestling with the problem and providing the fix!

	Cut where indicated and save to a file (/tmp/485.patch).  Then:

cd /
patch -p0 < /tmp/485.patch

cd /usr/src/ucb/ex
make install
make clean

	This and previous updates to 2.11BSD are available at the following
	locations:
	
	ftp://ftp.dfupdate.se/pub/pdp11/2.11BSD
	https://www.tuhs.org/Archive/Distributions/UCB/2.11BSD/Patches/
	ftp://ftp.2bsd.com/2.11BSD
	http://www.2bsd.com/2.11BSD

	Most (all) Web browsers have removed ftp: URL support and will use
	the http: links.  Commandline users with an ftp client  (found at
	https://ftp.gnu.org/gnu/inetutils/) can use anonymous ftp as always.

---------------------------cut here--------------------
*** ./usr/src/ucb/ex/ex_v.c.old	Thu Mar 13 07:43:40 2025
--- ./usr/src/ucb/ex/ex_v.c	Fri Mar 14 16:24:07 2025
***************
*** 5,11 ****
   */
  
  #if	!defined(lint) && defined(DOSCCS)
! static char *sccsid = "@(#)ex_v.c	7.8.1 (2.11BSD GTE) 12/9/94";
  #endif
  
  #include "ex.h"
--- 5,11 ----
   */
  
  #if	!defined(lint) && defined(DOSCCS)
! static char *sccsid = "@(#)ex_v.c	7.8.2 (2.11BSD) 2025/3/14";
  #endif
  
  #include "ex.h"
***************
*** 174,179 ****
--- 174,180 ----
  	register int c;
  	ttymode f;	/* mjm: was register */
  	int resize;
+ 	long oldmask;
  
  	if (!CA && UP == NOSTR) {
  		if (initev) {
***************
*** 223,230 ****
--- 224,233 ----
  	vmoving = 0;
  	f = ostart();
  	if (initev == 0) {
+ 		oldmask = sigblock(sigmask(SIGWINCH));
  		vcontext(dot, c);
  		vnline(NOSTR);
+ 		(void)sigsetmask(oldmask);
  	}
  	vmain();
  	Command = "visual";
*** ./VERSION.old	Thu Mar 13 13:04:34 2025
--- ./VERSION	Fri Mar 14 16:27:46 2025
***************
*** 1,5 ****
! Current Patch Level: 484
! Date: March 13, 2025
  
  2.11 BSD
  ============
--- 1,5 ----
! Current Patch Level: 485
! Date: March 14, 2025
  
  2.11 BSD
  ============