From sheldonh@axl.seasidesoftware.co.za  Mon Jan  7 06:02:21 2002
Return-Path: <sheldonh@axl.seasidesoftware.co.za>
Received: from axl.seasidesoftware.co.za (axl.seasidesoftware.co.za [196.31.7.201])
	by hub.freebsd.org (Postfix) with ESMTP id 9DA4837B404
	for <freebsd-gnats-submit@freebsd.org>; Mon,  7 Jan 2002 06:02:19 -0800 (PST)
Received: from sheldonh (helo=axl.seasidesoftware.co.za)
	by axl.seasidesoftware.co.za with local-esmtp (Exim 3.33 #1)
	id 16NaO5-0002p9-00
	for freebsd-gnats-submit@FreeBSD.org; Mon, 07 Jan 2002 16:04:29 +0200
Message-Id: <10858.1010412269@axl.seasidesoftware.co.za>
Date: Mon, 07 Jan 2002 16:04:29 +0200
From: Sheldon Hearn <sheldonh@starjuice.net>
Sender: Sheldon Hearn <sheldonh@axl.seasidesoftware.co.za>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Follow-up to bin/23912

>Number:         33648
>Category:       bin
>Synopsis:       Follow-up to bin/23912
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 07 06:10:00 PST 2002
>Closed-Date:    Mon Jan 7 13:41:43 PST 2002
>Last-Modified:  Wed Oct 26 05:08:25 GMT 2005
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 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
 
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mikeh 
State-Changed-When: Mon Jan 7 13:41:43 PST 2002 
State-Changed-Why:  
Followup to 23912. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33648 
>Unformatted:
