Weird problem with vi... "Not that many lines in buffer"

David H. Brierley dave at galaxia.zone1.com
Wed Sep 28 12:03:04 AEST 1988


In article <508 at icus.islp.ny.us> lenny at icus.islp.ny.us (Lenny Tropiano) writes:
>I just created this .signature file, and for some reason every time this
>is in a file, and I do a "vi" of that file I get the following message...
>
>".signature" 4 lines of 300 characters Not that many lines in buffer
>-- 
>lenny at icus.islp.ny.us      Telex: 154232428 ICUS         h: +1 (516) 968-8576

The problem is that vi sees the string "ex:" and assumes that whatever follows,
up to the next colon, is to be interpreted as an ex (line mode) command.  This
behaviour is only exhibited in the first and last four lines of the file.  What
is happenning in this case is that vi is attempting to interpret "154232428" as
a line number!  I would assume that you dont have that many lines in your file,
hence the diagnostic is informing you of that fact.  The most common use of
these "mode lines" that I have seen is to specify various options that are
unique to the file, i.e. wm=72 sw=4 ts=4 etc.  One thing that can cause great
confusion when using mode lines is that not only is the string "ex:" recognized,
so are the strings "vi:", "vx:", and "ei:".

I know of several source sites (mine included) that have modified vi so that
mode lines are ignored by default and you have to take special action to get
the editor to honor them.  Not only can they cause confusion, as they did in
this case, they are also a potential security hole.
-- 
David H. Brierley
Home: dave at galaxia.zone1.com   ...!rayssd!galaxia!dave
Work: dhb at rayssd.ray.com       {sun,decuac,gatech,necntc,ukma}!rayssd!dhb



More information about the Comp.unix.wizards mailing list