summaryrefslogtreecommitdiffstats
path: root/usr.bin/more/screen.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-09-22 01:19:13 +0000
committerache <ache@FreeBSD.org>1994-09-22 01:19:13 +0000
commite45f1435202cb2bf1c3a97dfc122d11155b5925a (patch)
treeb6391df45c81d39478b6e261fb9b24420643e912 /usr.bin/more/screen.c
parent6c7f19942f7afda8224cd0d083cde770c20e3a02 (diff)
downloadFreeBSD-src-e45f1435202cb2bf1c3a97dfc122d11155b5925a.zip
FreeBSD-src-e45f1435202cb2bf1c3a97dfc122d11155b5925a.tar.gz
1) Make ctype-aware expect chars in range 0200-0204 treated
as controls in any case. 2) Fix bug with incorrect column position when standouts occurse 3) Fix bug when last standouted char cause clearing next line in standout
Diffstat (limited to 'usr.bin/more/screen.c')
-rw-r--r--usr.bin/more/screen.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/usr.bin/more/screen.c b/usr.bin/more/screen.c
index edfae1e..2dc99ec 100644
--- a/usr.bin/more/screen.c
+++ b/usr.bin/more/screen.c
@@ -106,6 +106,11 @@ int bo_width, be_width; /* Printing width of boldface sequences */
int ul_width, ue_width; /* Printing width of underline sequences */
int so_width, se_width; /* Printing width of standout sequences */
+int mode_flags = 0;
+#define M_SO 1
+#define M_UL 2
+#define M_BO 4
+
/*
* These two variables are sometimes defined in,
* and needed by, the termcap library.
@@ -503,6 +508,12 @@ bell()
*/
clear()
{
+ if (mode_flags & M_SO)
+ so_exit();
+ if (mode_flags & M_UL)
+ ul_exit();
+ if (mode_flags & M_BO)
+ bo_exit();
tputs(sc_clear, sc_height, putchr);
}
@@ -512,6 +523,12 @@ clear()
*/
clear_eol()
{
+ if (mode_flags & M_SO)
+ so_exit();
+ if (mode_flags & M_UL)
+ ul_exit();
+ if (mode_flags & M_BO)
+ bo_exit();
tputs(sc_eol_clear, 1, putchr);
}
@@ -521,6 +538,7 @@ clear_eol()
so_enter()
{
tputs(sc_s_in, 1, putchr);
+ mode_flags |= M_SO;
}
/*
@@ -529,6 +547,7 @@ so_enter()
so_exit()
{
tputs(sc_s_out, 1, putchr);
+ mode_flags &= ~M_SO;
}
/*
@@ -538,6 +557,7 @@ so_exit()
ul_enter()
{
tputs(sc_u_in, 1, putchr);
+ mode_flags |= M_UL;
}
/*
@@ -546,6 +566,7 @@ ul_enter()
ul_exit()
{
tputs(sc_u_out, 1, putchr);
+ mode_flags &= ~M_UL;
}
/*
@@ -554,6 +575,7 @@ ul_exit()
bo_enter()
{
tputs(sc_b_in, 1, putchr);
+ mode_flags |= M_BO;
}
/*
@@ -562,6 +584,7 @@ bo_enter()
bo_exit()
{
tputs(sc_b_out, 1, putchr);
+ mode_flags &= ~M_BO;
}
/*
OpenPOWER on IntegriCloud