From owner-freebsd-bugs Mon Oct 2 16:48:25 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id C8E2537B502; Mon, 2 Oct 2000 16:48:21 -0700 (PDT) Received: (from sethk@localhost) by pike.osd.bsdi.com (8.11.0/8.9.3) id e92NmKX11364; Mon, 2 Oct 2000 16:48:20 -0700 (PDT) (envelope-from sethk) Date: Mon, 2 Oct 2000 16:48:19 -0700 From: Seth Kingsley To: gnats-admin@FreeBSD.ORG, freebsd-bugs@FreeBSD.ORG Subject: Re: bin/21654: Re: nvi's -c flag does no do what it is documented to do. (it does nothing) Message-ID: <20001002164819.B76593@osd.bsdi.com> References: <200010021901.MAA38034@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200010021901.MAA38034@freefall.freebsd.org>; from peter@FreeBSD.ORG on Mon, Oct 02, 2000 at 12:01:49PM -0700 X-Operating-System: FreeBSD 4.1-STABLE i386 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Synopsis: Re: nvi's -c flag does no do what it is documented to do. (it does nothing) I believe that this is part of nvi's compatiblity with traditional Vi in that it will not execute +cmd's when creating a new file to edit. This patch just makes it complain and notes it in the manual page: Index: common/exf.c =================================================================== RCS file: /ncvs/src/contrib/nvi/common/exf.c,v retrieving revision 1.3 diff -u -r1.3 exf.c --- common/exf.c 2000/01/10 09:17:46 1.3 +++ common/exf.c 2000/09/30 02:05:09 @@ -546,14 +546,17 @@ */ nb = 0; gp = sp->gp; - if (gp->c_option != NULL && !F_ISSET(sp->frp, FR_NEWFILE)) { + if (gp->c_option != NULL) { if (db_last(sp, &sp->lno)) return; if (sp->lno == 0) { sp->lno = 1; sp->cno = 0; } - if (ex_run_str(sp, + if (F_ISSET(sp->frp, FR_NEWFILE)) + msgq_str(sp, M_ERR, sp->frp->name, + "318|%s: Warning: +cmd ignored for new file"); + else if (ex_run_str(sp, "-c option", gp->c_option, strlen(gp->c_option), 1, 1)) return; gp->c_option = NULL; Index: docs/USD.doc/vi.man/vi.1 =================================================================== RCS file: /ncvs/src/contrib/nvi/docs/USD.doc/vi.man/vi.1,v retrieving revision 1.4 diff -u -r1.4 vi.1 --- docs/USD.doc/vi.man/vi.1 1997/09/18 06:49:40 1.4 +++ docs/USD.doc/vi.man/vi.1 2000/10/02 19:19:46 @@ -107,7 +107,9 @@ is not limited to positioning commands. This is the POSIX 1003.2 interface for the historic ``+cmd'' syntax. .I Nex/nvi -supports both the old and new syntax. +supports both the old and new syntax. If a +.B \-c +option is used when creating a new file, it is ignored. .TP .B \-e Start editing in ex mode, as if the command name were To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message