[net.bugs.4bsd] 4.?bsd vi insert bug on long lines with tabs on smart terminals

ado@elsie.UUCP (Arthur David Olson) (01/21/85)

Index:	cmd/ex/ex_vput.c

Description:
	When using "vi" to edit a file with long lines containing tabs,
	characters may disappear if you insert characters and are using
	a terminal that has "insert mode".

Repeat-By:
	Creating a file with a single line that has 71 'a's, a tab character,
	and four 'b's.  Then use "vi" on the file.  Position the cursor on the
	tab character (by, for example, tapping the 'f' key and then the tab
	key).  Then tap the 'i' key to go into insert mode, and tap the 'c' to
	insert a 'c'.  Now ask yourself:  "Where did those 'b's go?"

Fix:
  ed ex_vput.c
  /^vishft/;/(tabend + shft) \/ WCOLS/c
  #ifdef OLDVERSION
  		for (j = DEPTH(vcline) - 1; j > (tabend + shft) / WCOLS; j--) {
  #else
  		for (j = DEPTH(vcline) - 1; j > (tabend+shft-1) / WCOLS; j--) {
  #endif
  .
  w
  q
--
	..decvax!seismo!elsie!ado	(country code 1)(301) 496-5688
	DEC, VAX and Elsie are Digital Equipment and Borden trademarks