| Summary: | nvi ignores -c flag when creating a new file | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | sjhgnats <sjhgnats> | ||||
| Component: | bin | Assignee: | Mike Heffner <mikeh> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.3-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
sjhgnats
2001-10-22 01:10:01 UTC
State Changed From-To: open->feedback Can you test whether the similar patch in bin/21654 works? On 22-Oct-2001 mikeh@FreeBSD.ORG wrote: | Synopsis: nvi ignores -c flag when creating a new file | | State-Changed-From-To: open->feedback | State-Changed-By: mikeh | State-Changed-When: Sun Oct 21 18:08:38 PDT 2001 | State-Changed-Why: | Can you test whether the similar patch in bin/21654 works? | Actually nevermind, bin/21654 just makes it output a warning when used with a new file. Mike -- Mike Heffner <mheffner@[acm.]vt.edu> Blacksburg, VA <mikeh@FreeBSD.org> State Changed From-To: feedback->open bin/21654 just outputs a warning Responsible Changed From-To: freebsd-bugs->mikeh I'll take a look at this. State Changed From-To: open->closed From Keith Bostic: I believe that nvi follows historic practice -- there's a comment in the nvi sources (common/exf.c) that explains this: /* * 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. I suspect the reasoning is that you can load the wrong file, and then fix it, and still get your initial command. So: % vi '?bostic' /etc/Passwd :e /etc/passwd will do the right thing -- when you switch to the file you really wanted, the command is then executed. |