diff options
| author | alm <alm@NetBSD.org> | 1993-07-09 05:34:14 +0000 |
|---|---|---|
| committer | alm <alm@NetBSD.org> | 1993-07-09 05:34:14 +0000 |
| commit | 75de25bb937aed7d7fbdbd3a822fbc03d8bf6a08 (patch) | |
| tree | a8a314f717e88a1f7fb1700d111d7263e416f95a /lib/libcurses/refresh.c | |
| parent | cb880ccb9480246e8ba2026db43f12f1f2e8dde8 (diff) | |
added Andrew Chernov's patch set:
Standard curses library use eight bit for standout mode, so
8-bit characters displays like highlighted 7-bit characters.
This patch produce library which is fully compatible with all curses
programs and add 8-bit chars to all input/display functions.
---
I don't think, that any programs wish to use internal curses
attribute _STANDOUT directly, in expressions like:
addch( ch | _STANDOUT );
Normal interface use standout() and standend() functions instead.
Many programs use 'char' type (with sign extention) for input characters
and sign extention becomes _STANDOUT mode in this case.
So, I refuse this future and allow 8-bit characters for programs,
which is designed for 7-bit only ('char' type using instead of
'unsigned char').
---
This small patch fix unpleasant standard curses bug:
curses can't expand TAB at all (but tries).
A man who wrote this curses misplace SYNC_IN and SYNCH_OUT,
this patch exchange macro calls.
This patch useful for standard 7-bit curses too, for this
you must delete '_' symbol before waddbytes and apply patch.
---
Oh, NO! This curses are really buggy!
This small patch fix following problem:
[ assumed scrollok(stdscr, TRUE) ]
when addch(ch) at lower right corner of screen, curses are realy
gone mad instead if simple scrolling... Curses code assumed that
this will be done correctly, but implement it with two bugs.
Diffstat (limited to 'lib/libcurses/refresh.c')
| -rw-r--r-- | lib/libcurses/refresh.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/libcurses/refresh.c b/lib/libcurses/refresh.c index a4937c56fbc..62673d2f879 100644 --- a/lib/libcurses/refresh.c +++ b/lib/libcurses/refresh.c @@ -169,9 +169,11 @@ makech(win, wy) reg WINDOW *win; short wy; { - reg char *nsp, *csp, *ce; + reg chtype *nsp, *csp, *ce; reg short wx, lch, y; reg int nlsp, clsp; /* last space in lines */ + char *ce_tcap; + static chtype blank[] = {' ','\0'}; wx = win->_firstch[wy] - win->_ch_off; if (wx >= win->_maxx) @@ -186,7 +188,7 @@ short wy; y = wy + win->_begy; if (curwin) - csp = " "; + csp = blank; else csp = &curscr->_y[wy + win->_begy][wx + win->_begx]; @@ -199,9 +201,9 @@ short wy; } if (!curwin) - ce = CE; + ce_tcap = CE; else - ce = NULL; + ce_tcap = NULL; while (wx <= lch) { if (*nsp != *csp) { @@ -212,7 +214,7 @@ short wy; ly = y; lx = wx + win->_begx; while (*nsp != *csp && wx <= lch) { - if (ce != NULL && wx >= nlsp && *nsp == ' ') { + if (ce_tcap != NULL && wx >= nlsp && *nsp == ' ') { /* * check for clear to end-of-line */ @@ -235,7 +237,7 @@ short wy; *csp++ = ' '; return OK; } - ce = NULL; + ce_tcap = NULL; } /* * enter/exit standout mode as appropriate @@ -260,9 +262,9 @@ short wy; curscr->_flags &= ~_STANDOUT; } if (!curwin) - _putchar((*csp = *nsp) & 0177); + _putchar((*csp = *nsp)); else - _putchar(*nsp & 0177); + _putchar(*nsp); if (win->_flags&_FULLWIN && !curwin) scroll(curscr); ly = win->_begy+win->_cury; @@ -274,12 +276,12 @@ short wy; return ERR; } if (!curwin) - _putchar((*csp++ = *nsp) & 0177); + _putchar((*csp++ = *nsp)); else - _putchar(*nsp & 0177); + _putchar(*nsp); # ifdef FULLDEBUG fprintf(outf, - "MAKECH:putchar(%c)\n", *nsp & 0177); + "MAKECH:putchar(%c)\n", *nsp); # endif if (UC && (*nsp & _STANDOUT)) { _putchar('\b'); |
