summaryrefslogtreecommitdiffstats
path: root/usr.bin/more/command.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/command.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/command.c')
-rw-r--r--usr.bin/more/command.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/more/command.c b/usr.bin/more/command.c
index 51f5847..dcab842 100644
--- a/usr.bin/more/command.c
+++ b/usr.bin/more/command.c
@@ -76,6 +76,7 @@ static int wsearch; /* Search for matches (1) or non-matches (0) */
static
cmd_erase()
{
+ int c;
/*
* backspace past beginning of the string: this usually means
* abort the command.
@@ -84,7 +85,8 @@ cmd_erase()
return(1);
/* erase an extra character, for the carat. */
- if (CONTROL_CHAR(*--cp)) {
+ c = *--cp & 0xff;
+ if (CONTROL_CHAR(c)) {
backspace();
--cmd_col;
}
@@ -119,9 +121,9 @@ cmd_char(c)
/* in this order, in case werase == erase_char */
if (c == werase_char) {
if (cp > cmdbuf) {
- while (isspace(cp[-1]) && !cmd_erase());
- while (!isspace(cp[-1]) && !cmd_erase());
- while (isspace(cp[-1]) && !cmd_erase());
+ while (isspace(cp[-1] & 0xff) && !cmd_erase());
+ while (!isspace(cp[-1] & 0xff) && !cmd_erase());
+ while (isspace(cp[-1] & 0xff) && !cmd_erase());
}
return(cp == cmdbuf);
}
@@ -141,6 +143,7 @@ cmd_char(c)
if (CONTROL_CHAR(c)) {
putchr('^');
cmd_col++;
+ c &= ~0200;
c = CARAT_CHAR(c);
}
putchr(c);
@@ -273,11 +276,11 @@ exec_mca()
(void)search(0, cmdbuf, number, wsearch);
break;
case A_EXAMINE:
- for (p = cmdbuf; isspace(*p); ++p);
+ for (p = cmdbuf; isspace(*p & 0xff); ++p);
(void)edit(glob(p));
break;
case A_TAGFILE:
- for (p = cmdbuf; isspace(*p); ++p);
+ for (p = cmdbuf; isspace(*p & 0xff); ++p);
findtag(p);
if (tagfile == NULL)
break;
@@ -573,6 +576,7 @@ again: if (sigs)
start_mca(A_PREFIX, "");
if (CONTROL_CHAR(c)) {
putchr('^');
+ c &= ~0200;
c = CARAT_CHAR(c);
}
putchr(c);
OpenPOWER on IntegriCloud