Bug 33648

Summary: Follow-up to bin/23912
Product: Base System Reporter: Sheldon Hearn <sheldonh>
Component: binAssignee: GNATS administrator <gnats-admin>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 1.0-RELEASE   
Hardware: Any   
OS: Any   

Description Sheldon Hearn 2002-01-07 14:10:00 UTC
 The following interesting follow-up was sent privately by the
 originator.
 
 Ciao,
 Sheldon.
 
 ------- Forwarded Message
 
 Date: Mon, 31 Dec 2001 08:54:11 -0600 (CST)
 From: "Stephen D. Spencer" <gladiatr@boneyard.lawrence.ks.us>
 To: sheldonh@starjuice.net
 Subject: Re: nvi bug report (fwd)
 Message-ID: <Pine.BSF.4.10.10112310853390.5320-100000@madeline.boneyard.lawrence.ks.us>
 MIME-Version: 1.0
 Content-Type: TEXT/PLAIN; charset=US-ASCII
 
 
 Hey there,
 
 Just got this back.  Thanks for the follow-up on this issue.
 
 Regards,
 Stephen
 
 Stephen Spencer | 
                 |  "Come down off the cross. 
                 |    We can use the wood..." 
                 |                                T. Waits 
 
 
 - ---------- Forwarded message ----------
 Date: Mon, 31 Dec 2001 15:48:58 +0100
 From: Sven Verdoolaege <skimo@kotnet.org>
 To: Stephen D. Spencer <gladiatr@boneyard.lawrence.ks.us>
 Subject: Re: nvi bug report
 
 On Mon, Dec 31, 2001 at 08:30:33AM -0600, Stephen D. Spencer wrote:
 > 
 > Good morning, and happy new year!
 > 
 > I was wondering if you would take a moment over the upcoming days to review
 > the following nvi bug report.  I sent it to Keith Bostic last year, but I 
 > think it was slightly overshadowed by an upcoming db rollout!  Quite under-
 > standable.  At any rate, I also submitted a bug report w/ patch  to the FreeBSD 
 > folks around the same time.  The details and the diff are at the following 
 > URL.  The FreeBSD folks are interested in closing out the PR and would be 
 > willing to commit a blessed fix for this issue.
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/23912
 > 
 This has already been fixed in 1.81.5.
 Relevant patch below.
 
 skimo
 
 On Sun, Jul 08, 2001 at 03:34:24PM +0200, Sven Verdoolaege wrote:
 > On Sat, Jul 07, 2001 at 04:26:20PM -0700, Dima Dorfman wrote:
 > > nvi gets into an infinite loop when one executes this sequence:
 > > 
 > > 	:set leftright
 > > 	:set number
 > > 
 > > As far as I can tell, this happens with all versions.  The attached
 > > patch against 1.81.4 fixes the problem.
 > > 
 > I'd say it masks the problem.
 > Try the following instead and thanks for the report.
 > 
 > skimo
 > 
 > Index: vs_relative.c
 > ===================================================================
 > RCS file: /b/CVSROOT/vi/vi/vs_relative.c,v
 > retrieving revision 10.17
 > retrieving revision 10.18
 > diff -u -r10.17 -r10.18
 > --- vs_relative.c	2001/06/25 15:19:38	10.17
 > +++ vs_relative.c	2001/07/08 13:02:48	10.18
 > @@ -10,7 +10,7 @@
 >  #include "config.h"
 >  
 >  #ifndef lint
 > -static const char sccsid[] = "$Id: vs_relative.c,v 10.17 2001/06/25 15:19:38 skimo Exp $ (Berkeley) $Date: 2001/06/25 15:19:38 $";
 > +static const char sccsid[] = "$Id: vs_relative.c,v 10.18 2001/07/08 13:02:48 skimo Exp $ (Berkeley) $Date: 2001/07/08 13:02:48 $";
 >  #endif /* not lint */
 >  
 >  #include <sys/types.h>
 > @@ -102,6 +102,15 @@
 >  	int ch, leftright, listset;
 >  	CHAR_T *p;
 >  
 > +	/*
 > +	 * Initialize the screen offset.
 > +	 */
 > +	scno = 0;
 > +
 > +	/* Leading number if O_NUMBER option set. */
 > +	if (O_ISSET(sp, O_NUMBER))
 > +		scno += O_NUMBER_LENGTH;
 > +
 >  	/* Need the line to go any further. */
 >  	if (lp == NULL) {
 >  		(void)db_get(sp, lno, 0, &lp, &len);
 > @@ -113,7 +122,7 @@
 >  	if (lp == NULL) {
 >  done:		if (diffp != NULL)		/* XXX */
 >  			*diffp = 0;
 > -		return (0);
 > +		return scno;
 >  	}
 >  
 >  	/* Store away the values of the list and leftright edit options. */
 > @@ -121,15 +130,10 @@
 >  	leftright = O_ISSET(sp, O_LEFTRIGHT);
 >  
 >  	/*
 > -	 * Initialize the pointer into the buffer and screen and current
 > -	 * offsets.
 > +	 * Initialize the pointer into the buffer and current offset.
 >  	 */
 >  	p = lp;
 > -	curoff = scno = 0;
 > -
 > -	/* Leading number if O_NUMBER option set. */
 > -	if (O_ISSET(sp, O_NUMBER))
 > -		scno += O_NUMBER_LENGTH;
 > +	curoff = 0;
 >  
 >  	/* Macro to return the display length of any signal character. */
 >  #define	CHLEN(val) (ch = *(UCHAR_T *)p++) == '\t' &&			\
 
 
 
 ------- End of Forwarded Message
Comment 1 Mike Heffner freebsd_committer freebsd_triage 2002-01-07 21:41:43 UTC
State Changed
From-To: open->closed

Followup to 23912.