Chris Torek's warning on 11-squishing

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Tue May 8 10:27:02 AEST 1984


Sorry if I confused people.  I made up ``11-squishing'' on the spur
of the moment, and meant the kind of hacks one writes when trying
to squeeze a program written for a Vax onto the PDP-11 downstairs.
There's always a few more bytes you can save, if you reuse this
buffer here, over there, and there too.  Vi has a lot of this kind
of buffer reuse, mostly dealing with undo.

I haven't seen any bugs that would blow away an entire file (except
for the occasional segmentation fault), but there seem to be some
which would cause great anguish if one used undo after using a fancy
macro.  It's not nice to see all the text you typed in for the last
hour or two jump around, even if it is still all there in some form....

Let's see if I can find some bugs right now.

Aha, here's one.  First, a "map":

	:map = "ayy1GPu

Now type =; the cursor will jump to the top line and you'll get an
error about puts inside macros.  Now type U (capital u), and
something strange happens to the first line.  (I got the ``Newsgroups:''
line replaced by the ``Subject:'' line, for some reason.)

Just found another bug:  if you use a global command that invokes
a substitute command, and the substitute command happens to make
a line longer than 1023 characters after succeeding on a previous
line, the substitute tries to use undo to fix things, but the global
prevents the use of undo, and the editor buffer is left rather
clobbered.  (This was inside a :map'ped key, if you care to
experiment.)

Admittedly these cases are somewhat unlikely, but if you start
experimenting, you should be aware that there *are* bugs.

(For the record, these experiments were done on a 4.1BSD system.
4.2 may have new and improved vi bugs :-).)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at maryland



More information about the Comp.unix.wizards mailing list