From owner-freebsd-bugs Tue Aug 14 21: 2:57 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from iatl0x01.coxmail.com (iatl0x02.coxmail.com [206.157.225.11]) by hub.freebsd.org (Postfix) with ESMTP id 252F937B40C; Tue, 14 Aug 2001 21:02:43 -0700 (PDT) (envelope-from mheffner@novacoxmail.com) Received: from enterprise.muriel.penguinpowered.com ([209.249.161.66]) by iatl0x01.coxmail.com (InterMail vK.4.03.02.00 201-232-124 license eaa2928f5bcba31507d4d280f1027278) with ESMTP id <20010815040242.PMOV70.iatl0x01@enterprise.muriel.penguinpowered.com>; Wed, 15 Aug 2001 00:02:42 -0400 Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="_=XFMail.1.5.0.FreeBSD:20010814235912:291=_"; micalg=pgp-md5; protocol="application/pgp-signature" Date: Tue, 14 Aug 2001 23:59:12 -0400 (EDT) Reply-To: Mike Heffner From: Mike Heffner To: freebsd-gnats-submit@freebsd.org Subject: FW: Re: bin/12801: nvi infinite recursion with options "leftrigh Cc: FreeBSD-bugs 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 This message is in MIME format --_=XFMail.1.5.0.FreeBSD:20010814235912:291=_ Content-Type: multipart/mixed; boundary="_=XFMail.1.5.0.FreeBSD:20010814235912:291=_" This message is in MIME format --_=XFMail.1.5.0.FreeBSD:20010814235912:291=_ Content-Type: text/plain; charset=us-ascii Forwarding to audit-trail. -----FW: <20010814234350.A52363@unknown.whichever.org>----- Date: Tue, 14 Aug 2001 23:43:50 -0400 From: Alexander Litvin To: Sheldon Hearn Subject: Re: bin/12801: nvi infinite recursion with options "leftright" and "comment" Cc: mikeh@FreeBSD.org > In message about "Re: bin/12801: nvi infinite recursion with options "leftright" and "comment"" > on Fri, Jul 06, 2001, at 08:48:09 AM you wrote: > > > > Synopsis: nvi infinite recursion with options "leftright" and "comment" > > > > > > State-Changed-From-To: suspended->feedback > > > State-Changed-By: mikeh > > > State-Changed-When: Thu Jul 5 17:26:35 PDT 2001 > > > State-Changed-Why: > > > Is this fixed with the patch in bin/28687? > > > > Should be. :-) > > No, unfortunately it's not. Actually, as I investigated the problem, it is more severe then just using to incompatible options. That is, this infinite recursion can be "achieved" even without "comment" option -- it is enougth, for example, to do the following: 1) go to the line with number NUM, where 1 < NUM < "screen height"/2; 2) make the line to be on the top of the screen (e.g. by z+); 3) do :e What I figured is that during switching files vi somehow messes up the old and new state -- like sp (pointer to screen structure?) already contains (mostly) info about new file, but HMAP macro (what's this exactly?) still has information about old file position. The fact that this mess really works through vs_refresh() is, IMHO, accidential. The attached patch seems to fix the problem. This is sort of hack, because I don't exactly understand the guts of vi, and I have no idea how produce politically correct fix. But at least it doesn't do anything bad (IMHO). --- Laugh at your problems; everybody else does. --------------End of forwarded message------------------------- Mike -- Mike Heffner Fredericksburg, VA --_=XFMail.1.5.0.FreeBSD:20010814235912:291=_ Content-type: text/plain; NAME=vi.diff; charset=us-ascii Content-disposition: attachment; filename=vi.diff *** src/contrib/nvi/vi/vi.c.orig Tue Aug 14 23:13:30 2001 --- src/contrib/nvi/vi/vi.c Tue Aug 14 23:14:34 2001 *************** *** 399,404 **** --- 399,408 ---- if (F_ISSET(sp, SC_FSWITCH)) { F_CLR(sp, SC_FSWITCH); (void)sp->gp->scr_rename(sp, sp->frp->name, 1); + /* XXX */ + HMAP->lno = sp->lno; + HMAP->coff = 0; + HMAP->soff = 1; } /* If leaving vi, return to the main editor loop. */ --_=XFMail.1.5.0.FreeBSD:20010814235912:291=_-- End of MIME message --_=XFMail.1.5.0.FreeBSD:20010814235912:291=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7efOQFokZQs3sv5kRAuvuAJ0UDhHUc1UbDWNkv4CiscRvCeG8WwCcCGhB LwuMb75VTX/Indma8/kN6Ys= =0qy3 -----END PGP SIGNATURE----- --_=XFMail.1.5.0.FreeBSD:20010814235912:291=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message