X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/259c2c6122f3807a70f8fcf0f7858a3a84049c52..cce993784c134f39f9fb42a20879e94c3f40a36a:/usr/src/lib/libcurses/insertln.c diff --git a/usr/src/lib/libcurses/insertln.c b/usr/src/lib/libcurses/insertln.c index f05aed1495..92b6444336 100644 --- a/usr/src/lib/libcurses/insertln.c +++ b/usr/src/lib/libcurses/insertln.c @@ -1,10 +1,19 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)insertln.c 5.1 (Berkeley) %G%"; +#endif not lint + # include "curses.ext" /* * This routine performs an insert-line on the window, leaving * (_cury,_curx) unchanged. * - * %G% (Berkeley) @(#)insertln.c 1.1 */ winsertln(win) reg WINDOW *win; { @@ -12,16 +21,27 @@ reg WINDOW *win; { reg char *temp; reg int y; reg char *end; + reg int x; - temp = win->_y[win->_cury]; - win->_firstch[win->_cury] = 0; - win->_lastch[win->_cury] = win->_maxx - 1; +#ifdef DEBUG + fprintf(outf, "INSERTLN(%0.2o)\n", win); +#endif + if (win->_orig == NULL) + temp = win->_y[win->_maxy - 1]; for (y = win->_maxy - 1; y > win->_cury; --y) { - win->_y[y] = win->_y[y-1]; - win->_firstch[y] = 0; - win->_lastch[y] = win->_maxx - 1; + if (win->_orig == NULL) + win->_y[y] = win->_y[y - 1]; + else + bcopy(win->_y[y - 1], win->_y[y], win->_maxx); + touchline(win, y, 0, win->_maxx - 1); } + if (win->_orig == NULL) + win->_y[y] = temp; + else + temp = win->_y[y]; for (end = &temp[win->_maxx]; temp < end; ) *temp++ = ' '; - return OK; + touchline(win, y, 0, win->_maxx - 1); + if (win->_orig == NULL) + _id_subwins(win); }