summaryrefslogtreecommitdiffstats
path: root/lib/libedit
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-10-02 02:01:21 +0000
committerache <ache@FreeBSD.org>1994-10-02 02:01:21 +0000
commit4d6904b5432415c487d2876cecf1d5dcb61aaf2b (patch)
treeeebf5f351d2b6a17b398b5c404834c5ec7bb69f3 /lib/libedit
parent3788fddb1395aca3eb7a7c410891f69aeef9c9ed (diff)
downloadFreeBSD-src-4d6904b5432415c487d2876cecf1d5dcb61aaf2b.zip
FreeBSD-src-4d6904b5432415c487d2876cecf1d5dcb61aaf2b.tar.gz
Fix bug with 8-bit chars sign extention (ctype not works)
Diffstat (limited to 'lib/libedit')
-rw-r--r--lib/libedit/refresh.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libedit/refresh.c b/lib/libedit/refresh.c
index b64d011..51fe769 100644
--- a/lib/libedit/refresh.c
+++ b/lib/libedit/refresh.c
@@ -97,6 +97,7 @@ re_addc(el, c)
EditLine *el;
int c;
{
+ c &= 0xFF;
if (isprint(c)) {
re_putc(el, c);
return;
@@ -863,7 +864,8 @@ protected void
re_refresh_cursor(el)
EditLine *el;
{
- char *cp, c;
+ char *cp;
+ int c;
int h, v, th;
/* first we must find where the cursor is... */
@@ -873,7 +875,7 @@ re_refresh_cursor(el)
/* do input buffer to el->el_line.cursor */
for (cp = el->el_line.buffer; cp < el->el_line.cursor; cp++) {
- c = *cp;
+ c = *cp & 0xFF;
h++; /* all chars at least this long */
if (c == '\n') { /* handle newline in data part too */
@@ -944,9 +946,9 @@ protected void
re_fastaddc(el)
EditLine *el;
{
- char c;
+ int c;
- c = el->el_line.cursor[-1];
+ c = el->el_line.cursor[-1] & 0xFF;
if (c == '\t' || el->el_line.cursor != el->el_line.lastchar) {
re_refresh(el); /* too hard to handle */
OpenPOWER on IntegriCloud