From owner-freebsd-bugs Thu Jan 17 17:13:24 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from vagabond.auriga.ru (vagabond.auriga.ru [80.240.102.246]) by hub.freebsd.org (Postfix) with ESMTP id E390C37B402; Thu, 17 Jan 2002 17:13:18 -0800 (PST) Received: from localhost (localhost [[UNIX: localhost]]) by vagabond.auriga.ru (8.11.2/8.11.2) id g0I1DHA06976; Fri, 18 Jan 2002 04:13:17 +0300 Content-Type: text/plain; charset="koi8-r" From: "Alexey V. Neyman" To: freebsd-bugs@FreeBSD.org Subject: Re: bin/26869: vi(1) crashes in viewing a file with long lines Date: Fri, 18 Jan 2002 04:13:17 +0300 X-Mailer: KMail [version 1.2] References: <200201180050.g0I0o3B30448@freefall.freebsd.org> In-Reply-To: <200201180050.g0I0o3B30448@freefall.freebsd.org> Cc: sheldonh@FreeBSD.org MIME-Version: 1.0 Message-Id: <0201180413170G.01587@vagabond.auriga.ru> Content-Transfer-Encoding: 8bit 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 Here it is. Index: vs_line.c =================================================================== RCS file: /usr/local/cvsroot/src/contrib/nvi/vi/vs_line.c,v retrieving revision 1.2 diff -u -r1.2 vs_line.c --- vs_line.c 2 Aug 1998 15:18:44 -0000 1.2 +++ vs_line.c 18 Jan 2002 00:49:03 -0000 @@ -324,8 +324,11 @@ /* If the line is on the screen, quit. */ if (is_cached) goto ret1; - } else + } else { + if (sp->cno >= len) + sp->cno = len - 1; cno_cnt = (sp->cno - offset_in_line) + 1; + } /* This is the loop that actually displays characters. */ ecbp = (cbp = cbuf) + sizeof(cbuf) - 1; -- <-------------------------> ) May the Sun and Water ( Regards, Alexey V. Neyman ) always fall upon you! ( mailto:alex.neyman@auriga.ru <-------------------------> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message