Fix deadlock between warning display and refresh engines. This fix
is taken from nvi-1.51.5. PR: bin/3170 Reported by: fenner Obtained from: skimo@kotnet.org MFC after: 1 month
This commit is contained in:
parent
b4f6fcd394
commit
17c17f89c5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/nvi/dist/; revision=90025
@ -49,7 +49,7 @@ vs_line(sp, smp, yp, xp)
|
|||||||
size_t chlen, cno_cnt, cols_per_screen, len, nlen;
|
size_t chlen, cno_cnt, cols_per_screen, len, nlen;
|
||||||
size_t offset_in_char, offset_in_line, oldx, oldy;
|
size_t offset_in_char, offset_in_line, oldx, oldy;
|
||||||
size_t scno, skip_cols, skip_screens;
|
size_t scno, skip_cols, skip_screens;
|
||||||
int ch, dne, is_cached, is_partial, is_tab;
|
int ch, dne, is_cached, is_partial, is_tab, no_draw;
|
||||||
int list_tab, list_dollar;
|
int list_tab, list_dollar;
|
||||||
char *p, *cbp, *ecbp, cbuf[128];
|
char *p, *cbp, *ecbp, cbuf[128];
|
||||||
|
|
||||||
@ -61,10 +61,11 @@ vs_line(sp, smp, yp, xp)
|
|||||||
* If ex modifies the screen after ex output is already on the screen,
|
* If ex modifies the screen after ex output is already on the screen,
|
||||||
* don't touch it -- we'll get scrolling wrong, at best.
|
* 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)
|
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))
|
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
|
* Assume that, if the cache entry for the line is filled in, the
|
||||||
@ -73,7 +74,7 @@ vs_line(sp, smp, yp, xp)
|
|||||||
* cursor position, we can just return.
|
* cursor position, we can just return.
|
||||||
*/
|
*/
|
||||||
is_cached = SMAP_CACHE(smp);
|
is_cached = SMAP_CACHE(smp);
|
||||||
if (yp == NULL && is_cached)
|
if (yp == NULL && (is_cached || no_draw))
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -158,7 +159,7 @@ vs_line(sp, smp, yp, xp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If the line is on the screen, quit. */
|
/* If the line is on the screen, quit. */
|
||||||
if (is_cached)
|
if (is_cached || no_draw)
|
||||||
goto ret1;
|
goto ret1;
|
||||||
|
|
||||||
/* Set line cache information. */
|
/* Set line cache information. */
|
||||||
@ -325,7 +326,7 @@ empty: (void)gp->scr_addstr(sp,
|
|||||||
offset_in_line + cols_per_screen < sp->cno) {
|
offset_in_line + cols_per_screen < sp->cno) {
|
||||||
cno_cnt = 0;
|
cno_cnt = 0;
|
||||||
/* If the line is on the screen, quit. */
|
/* If the line is on the screen, quit. */
|
||||||
if (is_cached)
|
if (is_cached || no_draw)
|
||||||
goto ret1;
|
goto ret1;
|
||||||
} else
|
} else
|
||||||
cno_cnt = (sp->cno - offset_in_line) + 1;
|
cno_cnt = (sp->cno - offset_in_line) + 1;
|
||||||
@ -389,12 +390,12 @@ empty: (void)gp->scr_addstr(sp,
|
|||||||
*xp += O_NUMBER_LENGTH;
|
*xp += O_NUMBER_LENGTH;
|
||||||
|
|
||||||
/* If the line is on the screen, quit. */
|
/* If the line is on the screen, quit. */
|
||||||
if (is_cached)
|
if (is_cached || no_draw)
|
||||||
goto ret1;
|
goto ret1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the line is on the screen, don't display anything. */
|
/* If the line is on the screen, don't display anything. */
|
||||||
if (is_cached)
|
if (is_cached || no_draw)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#define FLUSH { \
|
#define FLUSH { \
|
||||||
|
Loading…
Reference in New Issue
Block a user