4.?bsd vi insert bug on long lines with tabs on smart terminals (w/fix)
Arthur David Olson
ado at elsie.UUCP
Tue Jan 22 04:19:23 AEST 1985
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
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list