[net.bugs.usg] bug in vi

hansen@pegasus.UUCP (Tony L. Hansen) (10/10/85)

< Subject: bug in 3.6 vi (probably 3.7 also)
< 
< Description:
< 	Vi has a bug in it when the ^^ (control ^) command is used if the
<     current file has been modified and there was no previous file edited
<     and vi set for autowrite.
<     ...
<     When, under the above circumstances, this key is hit, the current file
<     will be written out, the error message of "No filename substitute for #"
<     will be displayed, then the last line of the file will REPLACE the
<     current line the cursor is on.  If at this point the ^^ key is 
<     accidently hit again, the file, now with a bogus line, will be written
<     out again.

I just checked my beta-version of 3.10 Vi (the version going into UNIX
System Vr3) and the bug still exists. Maybe it'll get fixed for Vr4.

					Tony Hansen
					ihnp4!pegasus!hansen

chris@umcp-cs.UUCP (Chris Torek) (10/11/85)

I posted this once before but I think it did not make it out of the
local machine.  Apologies if you have seen this already ...

This is not the correct way to fix it, but a

	forbid(altfile[0] == 0);

under `case CTRL(^)' in ex_vmain.c would get around the problem.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@mimsy.umd.edu

dce@hammer.UUCP (David Elliott) (10/15/85)

This bug seems to be just an instance of a problem in the error printing code.

Here are two known ways of making this kind of problem happen:

1. vi nonexistentfile
ahi there david

	ews^[--wcw^[u^^

(^[ is escape, ^^ is control-^)
The first line becomes the same as the last line.

2. vi nonexistentfile
Alternately hit the interrupt and escape keys ten or fifteen times. Then,
type ^L to redraw the screen. The first line of the file is now the word
"Interrupt".

			David Elliott

nick@inset.UUCP (Nick Stoughton) (10/24/86)

I don't know if anyone in the mists of time has noticed and reported this
feature before, but there is a serious bug in the line folding
stuff when wrapmargin is non-zero.

Repeat-by:
	Set wrapmargin=10.
	Create yourself a small file with the same line copied 3 or 4 times
	with each line just shorter than where the line break would occur.
	Go to the last word on line 1. Add in some text to cause a line split.
	Got to the last word on line 2.
	Type '.' to repeat the insert.
	Observe

Fix-by:
	Don't know...I haven't the time to look just now.

-- 
--------
Nick Stoughton
nick@inset.co.uk		Hit it with a hammer -- sure to work then!
nick@inset.UUCP
...!ukc!inset!nick

paul@devon.UUCP (Paul Sutcliffe Jr.) (10/30/86)

In article <1090@inset.UUCP>, nick@inset.UUCP (Nick Stoughton) writes:
> I don't know if anyone in the mists of time has noticed and reported this
> feature before, but there is a serious bug in the line folding
> stuff when wrapmargin is non-zero.
> 
> Repeat-by:
> 	[ showed what to do ]

Must not be a unique problem.  I tried the "repeat-by" steps with
my vi and had the same thing occur (I guess, Nick just says "Observe",
and I assume that what I saw is what he meant).

For the record, I have a Tandy Model 16 using XENIX/68000 3.0; the
version of vi is 3.7.

-Paul
-- 
Paul Sutcliffe, Jr.	 UUCP: {seismo,ihnp4,allegra,rutgers}!cbmvax!devon!paul
Devon Computer Services  COMPUSERVE: 76176,502
Allentown, Penna.	 "I love work ..."
+1 215 398 3776 	 "... I could sit and watch people do it all day!"