Bugs in ex/vi

ber at enea.UUCP ber at enea.UUCP
Fri Jun 24 01:44:09 AEST 1983


I'm quite convinced that these two bugs in vi (version 3.6) has been
discussed before somewhere, but just in case ...

1. An error in the address evaluation for the command "^B" dispositions
   the line on the screen and it can even make the first line modified.
   Do a ":se number" and then 3^F followed by 3^B. You don't end up at
   the beginning of the file again.

   The fix:
   In ex_vmain.c for the ^B-case it says

	case CTRL(b):
		...
			addr = dot - vcline - 2 + (cnt-1)*basWLINES;
  
   which should be
			...                 + 2 - .......

2. The other one I say is a bug even if someone would say it's a feature.
   If you create a new file with "vi foo" and then do a ":r otherfoo", then
   exit with "ZZ". The file "foo" is gone!! Even if you insert new lines in
   "foo" and then do a ":r", the new file will disappear. I'm not sure where
   to fix this, not introducing a new bug. It's the handling of all these
   "chng"-flags that's a bit of a mess. In ex_io.c the routine "rop3" ends
   with a sync(), which resets the chng-flag. If one make the end of "rop"
   to look like

	rop3(c);
	if (c == 'r')
		change();

   it seems to fix it. Would appreciate any comments.

Is there anyone compiling, in some organized form, all bug reports while
waiting for the next release from Bell/Berkeley ("All about bugs in vi",
"... in csh", "... in nroff")? Anything for USENIX, EUUG?

	Bjorn Eriksen	(...!decvax!mcvax!enea!ber)
	ENEA DATA Sweden



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