Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Oct 2001 10:02:55 +1000 (EST)
From:      Steve Horan <sjhgnats@tracking.amos.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/31420: nvi ignores -c flag when creating a new file
Message-ID:  <20011022000255.4820219D42@squishycow.goldenterrace.com.au>

next in thread | raw e-mail | index | archive | help

>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"
	<type random crap> - it doesn't wrap, and no errors are given. -c is silently ignored.
	
	Or:
	nvi -c "set wraplen=10" foobar
	<type random crap> - again, -c is silently ignored

	touch foobar
	nvi -c "set wraplen=10" foobar
	<type random crap> - 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011022000255.4820219D42>