Date: Tue, 22 Jan 2002 13:30:02 -0800 (PST) From: "Alexey V. Neyman" <alex.neyman@auriga.ru> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/3170: vi freaks and dump core if user doesn't exist Message-ID: <200201222130.g0MLU2303056@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/3170; it has been noted by GNATS.
From: "Alexey V. Neyman" <alex.neyman@auriga.ru>
To: bug-followup@freebsd.org
Cc:
Subject: Re: bin/3170: vi freaks and dump core if user doesn't exist
Date: Wed, 23 Jan 2002 00:26:35 +0300
Adding to Audit-Trail.
The patch below solves the problem.
---------- Forwarded Message ----------
Subject: Re: :set leftright fix? (FreeBSD PR 26869)
Date: Tue, 22 Jan 2002 22:05:27 +0100
From: Sven Verdoolaege <skimo@kotnet.org>
To: "Alexey V. Neyman" <alex.neyman@auriga.ru>
Can you reproduce this in 1.81.5 ?
If not, then maybe this patch (which is in 1.81.5) will help:
Index: vs_line.c
===================================================================
RCS file: /b/CVSROOT/vi/vi/vs_line.c,v
retrieving revision 10.32
retrieving revision 10.33
diff -u -r10.32 -r10.33
--- vs_line.c 2001/04/27 19:57:33 10.32
+++ vs_line.c 2001/05/10 19:25:49 10.33
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "$Id: vs_line.c,v 10.32 2001/04/27
19:57:33 skimo Exp $ (Berkeley) $Date: 2001/04/27 19:57:33 $";
+static const char sccsid[] = "$Id: vs_line.c,v 10.33 2001/05/10
19:25:49 skimo Exp $ (Berkeley) $Date: 2001/05/10 19:25:49 $";
#endif /* not lint */
#include <sys/types.h>
@@ -49,7 +49,7 @@
size_t chlen, cno_cnt, cols_per_screen, len, nlen;
size_t offset_in_char, offset_in_line, oldx, oldy;
size_t scno, skip_cols, skip_screens;
- int dne, is_cached, is_partial, is_tab;
+ int dne, is_cached, is_partial, is_tab, no_draw;
int list_tab, list_dollar;
CHAR_T *p;
CHAR_T *cbp, *ecbp, cbuf[128];
@@ -63,10 +63,11 @@
* If ex modifies the screen after ex output is already on the screen,
* don't touch it -- we'll get scrolling wrong, at best.
*/
+ no_draw = 0;
if (!F_ISSET(sp, SC_TINPUT_INFO) && VIP(sp)->totalcount > 1)
- return (0);
+ no_draw = 1;
if (F_ISSET(sp, SC_SCR_EXWROTE) && smp - HMAP != LASTLINE(sp))
- return (0);
+ no_draw = 1;
/*
* Assume that, if the cache entry for the line is filled in, the
@@ -75,7 +76,7 @@
* cursor position, we can just return.
*/
is_cached = SMAP_CACHE(smp);
- if (yp == NULL && is_cached)
+ if (yp == NULL && (is_cached || no_draw))
return (0);
/*
@@ -160,7 +161,7 @@
}
/* If the line is on the screen, quit. */
- if (is_cached)
+ if (is_cached || no_draw)
goto ret1;
/* Set line cache information. */
@@ -324,7 +325,7 @@
offset_in_line + cols_per_screen < sp->cno) {
cno_cnt = 0;
/* If the line is on the screen, quit. */
- if (is_cached)
+ if (is_cached || no_draw)
goto ret1;
} else
cno_cnt = (sp->cno - offset_in_line) + 1;
@@ -391,12 +392,12 @@
*xp += O_NUMBER_LENGTH;
/* If the line is on the screen, quit. */
- if (is_cached)
+ if (is_cached || no_draw)
goto ret1;
}
/* If the line is on the screen, don't display anything. */
- if (is_cached)
+ if (is_cached || no_draw)
continue;
#define FLUSH { \
skimo
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?200201222130.g0MLU2303056>
