From j@ida.interface-business.de  Wed Sep 27 03:16:29 1995
Received: from mail.Germany.EU.net (mail.Germany.EU.net [192.76.144.65])
          by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id DAA26780
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 27 Sep 1995 03:16:22 -0700
Received: by mail.Germany.EU.net with UUCP (5.59:10/EUnetD-2.5.2.b) via EUnet
	id LAA14396; Wed, 27 Sep 1995 11:16:07 +0100
Received: from ida.interface-business.de (ida.interface-business.de [193.101.57.203]) by innocence.interface-business.de (8.6.11/8.6.9) with ESMTP id LAA03550; Wed, 27 Sep 1995 11:50:52 +0100
Received: (from j@localhost) by ida.interface-business.de (8.6.11/8.6.9) id KAA14881; Wed, 27 Sep 1995 10:52:30 +0100
Message-Id: <199509270952.KAA14881@ida.interface-business.de>
Date: Wed, 27 Sep 1995 10:52:30 +0100
From: "J. Wunsch" <j@ida.interface-business.de>
Reply-To: joerg_wunsch@interface-business.de
To: FreeBSD-gnats-submit@freebsd.org
Cc: bostic@cs.berkeley.edu
Subject: vi cannot edit a file where the name starts with +
X-Send-Pr-Version: 3.2

>Number:         743
>Category:       bin
>Synopsis:       vi cannot edit a file where the name starts with +
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    scrappy
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 27 03:20:02 PDT 1995
>Closed-Date:    Sat Nov 9 18:02:04 PST 1996
>Last-Modified:  Sat Nov  9 18:03:38 PST 1996
>Originator:     J. Wunsch
>Release:        FreeBSD 2.0-BUILT-19950603 i386  (actually 2.0.5R)
>Organization:
interface business GmbH, Dresden
>Environment:

FreeBSD 2.0.5R

>Description:

vi cannot edit a file that's name is starting with a plus sign.

>How-To-Repeat:

touch +foo
vi +foo
~
...
~
/tmp/vi.014780: new file: line 1;  The foo command is unknown.

:e +foo yields the same.

>Fix:
	
Prepending a directory component (e.g. "./") works around the problem.
>Release-Note:
>Audit-Trail:

From: Mike Pritchard <mpp@mpp.minn.net>
To: joerg_wunsch@interface-business.de
Cc: FreeBSD-gnats-submit@freebsd.org, bostic@cs.berkeley.edu
Subject: Re: bin/743: vi cannot edit a file where the name starts with +
Date: Wed, 27 Sep 1995 05:43:10 -0500 (CDT)

 J. Wunsch wrote:
 > 
 > >Description:
 > 
 > vi cannot edit a file that's name is starting with a plus sign.
 > 
 > >How-To-Repeat:
 > 
 > touch +foo
 > vi +foo
 > ~
 > ...
 > ~
 > /tmp/vi.014780: new file: line 1;  The foo command is unknown.
 > 
 > :e +foo yields the same.
 > 
 > >Fix:
 > 	
 > Prepending a directory component (e.g. "./") works around the problem.
 
 From the vi man page:
 
      The following options are available:
 
      -c      Execute cmd immediately after starting the edit session.  Partic-
 	     ularly useful for initial positioning in the file, however cmd is
 	     not limited to positioning commands.  This is the POSIX 1003.2
 	     interface for the historic ``+cmd'' syntax.  Nex/nvi supports
 	     both the old and new syntax.
 
 As for the "vi +foo" problem, note the "+cmd" syntax above.  I don't 
 think that I would consider this a real "bug".  It seems to fall into 
 the same category as trying to use rm to remove a file that starts with 
 a dash (-) (and please, lets not get into a long discussion on that...).
 
 The ":e +foo" problem does look like a real bug.
 -- 
 Mike Pritchard
 mpp@mpp.minn.net
 "Go that way.  Really fast.  If something gets in your way, turn"

From: J Wunsch <j@ida.interface-business.de>
To: mpp@mpp.minn.net (Mike Pritchard)
Cc: joerg_wunsch@interface-business.de, FreeBSD-gnats-submit@freebsd.org,
        bostic@cs.berkeley.edu
Subject: Re: bin/743: vi cannot edit a file where the name starts with +
Date: Wed, 27 Sep 1995 12:50:08 +0100 (MET)

 As Mike Pritchard wrote:
 > 
 > > vi +foo
 > > ~
 > > ...
 > > ~
 > > /tmp/vi.014780: new file: line 1;  The foo command is unknown.
 
 > As for the "vi +foo" problem, note the "+cmd" syntax above.
 
 Of course, this has been quite clear to me.
 
 >  I don't 
 > think that I would consider this a real "bug".  It seems to fall into 
 > the same category as trying to use rm to remove a file that starts with 
 > a dash (-) (and please, lets not get into a long discussion on that...).
 
 But for removing a file starting with a dash, there's a well-known
 interface to work around it (--).  I'd rather suggest for vi to also
 accept a ``--'' to end scanning the command line for options.
 
 -- 
 cheers,
 
 J"org Wunsch

From: Keith Bostic <bostic@BSDI.COM>
To: j@ida.interface-business.de
Cc: FreeBSD-gnats-submit@freebsd.org, mpp@mpp.minn.net
Subject: Re: bin/743: vi cannot edit a file where the name starts with +
Date: Wed, 27 Sep 1995 20:18:07 -0600

 > But for removing a file starting with a dash, there's a well-known
 > interface to work around it (--).  I'd rather suggest for vi to also
 > accept a ``--'' to end scanning the command line for options.
 
 I agree.  Since nvi uses getopt(3), "--" does, in general, work.
 exactly as it does in rm.
 
 Unfortunately, +cmd arguments are translated into -c cmd before
 getopt is called, so the result in the case of a leading + sign
 in an argument is not what the user wanted.
 
 I'll fix this in the next version of nvi.
 
 --keith
Responsible-Changed-From-To: freebsd-bugs->wosch 
Responsible-Changed-By: scrappy 
Responsible-Changed-When: Sun May 26 23:07:06 PDT 1996 
Responsible-Changed-Why:  
used wosch for this last time...should stay consistent, no? 
Responsible-Changed-From-To: wosch->scrappy 
Responsible-Changed-By: scrappy 
Responsible-Changed-When: Mon May 27 00:13:42 PDT 1996 
Responsible-Changed-Why:  
I've been corrected...so I'll look into it 
State-Changed-From-To: open->analyzed 
State-Changed-By: fenner 
State-Changed-When: Mon Oct 21 15:07:03 PDT 1996 
State-Changed-Why:  
nvi author promises to fix it in next release

State-Changed-From-To: analyzed->closed 
State-Changed-By: fenner 
State-Changed-When: Sat Nov 9 18:02:04 PST 1996 
State-Changed-Why:  
With  nvi-1.79, you can 
vi -- +foo 
and 
:e + +foo 

The second is not very intuitive.  (and you can't :e -- +foo). 
>Unformatted:
