don't erase the last character when returning ERR
[unix-history] / usr / src / lib / libcurses / delch.c
CommitLineData
8f970554
KA
1# include "curses.ext"
2
3/*
4 * This routine performs an insert-char on the line, leaving
5 * (_cury,_curx) unchanged.
6 *
7 * @(#)delch.c 1.1 (Berkeley) %G%
8 */
9wdelch(win)
10reg WINDOW *win; {
11
12 reg char *temp1, *temp2;
13 reg char *end;
14
15 end = &win->_y[win->_cury][win->_maxx - 1];
16 temp2 = &win->_y[win->_cury][win->_curx + 1];
17 temp1 = temp2 - 1;
18 while (temp1 < end)
19 *temp1++ = *temp2++;
20 *temp1 = ' ';
21 win->_lastch[win->_cury] = win->_maxx - 1;
22 if (win->_firstch[win->_cury] == _NOCHANGE ||
23 win->_firstch[win->_cury] > win->_curx)
24 win->_firstch[win->_cury] = win->_curx;
25 return OK;
26}