Subject: Re: bin/24676: vi -c flag does not work correctly
To: None <Peter.Bex@student.kun.nl>
From: Aymeric Vincent <vincent@labri.fr>
List: netbsd-bugs
Date: 03/05/2004 18:07:00
	Hi,

> When using the -c flag in vi to tell it to execute a command on 
> startup, it
> ignores it unless a file is passed as extra argument. [...]

Quoting from nvi sources, this looks like the desired behaviour:

         /*
          * Historically, initial commands (the -c option) weren't 
executed
          * until a file was loaded, e.g. "vi +10 nofile", followed by an
          * :edit or :tag command, would execute the +10 on the file 
loaded
          * by the subsequent command, (assuming that it existed).  This
          * applied as well to files loaded using the tag commands, and 
we
          * follow that historic practice.  Also, all initial commands 
were
          * ex commands and were always executed on the last line of the 
file.

(see src/usr.bin/vi/common/exf.c)

Regards,
  Aymeric