From owner-freebsd-bugs Sun Oct 21 17:10: 5 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 33F4937B405 for ; Sun, 21 Oct 2001 17:10:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9M0A2Z25550; Sun, 21 Oct 2001 17:10:02 -0700 (PDT) (envelope-from gnats) Received: from squishycow.goldenterrace.com.au (squishycow.goldenterrace.com.au [203.41.110.130]) by hub.freebsd.org (Postfix) with ESMTP id B0F2837B405 for ; Sun, 21 Oct 2001 17:02:57 -0700 (PDT) Received: by squishycow.goldenterrace.com.au (Postfix, from userid 0) id 4820219D42; Mon, 22 Oct 2001 10:02:55 +1000 (EST) Message-Id: <20011022000255.4820219D42@squishycow.goldenterrace.com.au> Date: Mon, 22 Oct 2001 10:02:55 +1000 (EST) From: Steve Horan Reply-To: Steve Horan To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/31420: nvi ignores -c flag when creating a new file Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 31420 >Category: bin >Synopsis: nvi ignores -c flag when creating a new file >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Oct 21 17:10:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Steve Horan >Release: FreeBSD 4.3-STABLE i386 >Organization: n/a >Environment: System: FreeBSD 4.3-STABLE FreeBSD 4.3-STABLE #1: Sun Jul 22 10:59:34 EST 2001 The sources used for nvi are the latest from 4.4-STABLE >Description: "nvi -c "set someoption=xx" newfile" ignores the -c flag if newfile doesn't already exist. >How-To-Repeat: To test: nvi -c "set wraplen=10" - it doesn't wrap, and no errors are given. -c is silently ignored. Or: nvi -c "set wraplen=10" foobar - again, -c is silently ignored touch foobar nvi -c "set wraplen=10" foobar - it now wraps. >Fix: This simple patch seems to fix the problem. I am not very familiar with all the inner workings of nvi, so it may break other things. Can someone clarify if this is true/false? Working dir for this patch is: /usr/src/contrib/nvi --- common/exf.c.orig Mon Oct 22 09:43:36 2001 +++ common/exf.c Mon Oct 22 09:43:04 2001 @@ -546,7 +546,7 @@ */ 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) { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message