diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-11-26 04:02:03 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-11-26 04:02:03 +0000 |
commit | bda33b7e716d56bf1a9ecccb7e2543889f9ab1d3 (patch) | |
tree | 7bc4bcdf70ecc1d045693a309e96b304e1b49c33 /lib/libcurses/lib_clreol.c | |
parent | cd15e61d557c4704743905eae7b88ae927cf0394 (diff) |
ncurses 4.1 + changes to work with our terminfo libs (instead of
the ncurses ones). Changes are #ifdef EXTERN_TERMINFO.
Post 4.1 patches will be applied in a separate commit.
Diffstat (limited to 'lib/libcurses/lib_clreol.c')
-rw-r--r-- | lib/libcurses/lib_clreol.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/libcurses/lib_clreol.c b/lib/libcurses/lib_clreol.c index 146432ac575..6ffd0fcee53 100644 --- a/lib/libcurses/lib_clreol.c +++ b/lib/libcurses/lib_clreol.c @@ -27,28 +27,35 @@ ** */ -#include "curses.priv.h" +#include <curses.priv.h> + +MODULE_ID("Id: lib_clreol.c,v 1.9 1997/02/01 23:22:54 tom Exp $") int wclrtoeol(WINDOW *win) { chtype *maxx, *ptr, *end; short y, x, minx; - T(("wclrtoeol(%p) called", win)); + T((T_CALLED("wclrtoeol(%p)"), win)); y = win->_cury; x = win->_curx; - if (win->_flags & _NEED_WRAP + + /* + * We don't want to clear if we just wrapped the cursor. There's no + * point in clearing if we're not on a legal position, either. + */ + if (win->_flags & _WRAPPED || y > win->_maxy || x > win->_maxx) - return ERR; + returnCode(ERR); end = &win->_line[y].text[win->_maxx]; minx = _NOCHANGE; maxx = &win->_line[y].text[x]; for (ptr = maxx; ptr <= end; ptr++) { - int blank = _nc_render(win, win->_line[y].text[x], BLANK); + chtype blank = _nc_background(win); if (*ptr != blank) { maxx = ptr; @@ -66,5 +73,5 @@ short y, x, minx; win->_line[y].lastchar = maxx - win->_line[y].text; } _nc_synchook(win); - return(OK); + returnCode(OK); } |