#ifndef lint
static char
sccsid[] = "@(#)clrtobot.c 1.7 88/02/08 SMI";
#endif
#include <stddef.h>
#include "curses.ext"
int
wclrtobot(WINDOW *win)
{
int y;
char *sp, *end, *maxx;
int startx;
ptrdiff_t minx;
startx = win->_curx;
for (y = win->_cury; y < win->_maxy; y++) {
minx = _NOCHANGE;
end = &win->_y[y][win->_maxx];
for (sp = &win->_y[y][startx]; sp < end; sp++)
if (*sp != ' ') {
maxx = sp;
if (minx == _NOCHANGE)
minx = sp - win->_y[y];
*sp = ' ';
}
if (minx != _NOCHANGE)
(void) touchline(win, y, (int)minx,
(int)(maxx - &win->_y[y][0]));
startx = 0;
}
return (OK);
}