X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/e804469b5b0975de34bae1e66c3e6371249d3ee7..0f4556f12c8f75078501c9d1338ae7648a97f975:/usr/src/usr.lib/libcurses/scroll.c diff --git a/usr/src/usr.lib/libcurses/scroll.c b/usr/src/usr.lib/libcurses/scroll.c index 015c313c56..8aa2d580c7 100644 --- a/usr/src/usr.lib/libcurses/scroll.c +++ b/usr/src/usr.lib/libcurses/scroll.c @@ -3,7 +3,7 @@ /* * This routine scrolls the window up a line. * - * 5/11/81 (Berkeley) @(#)scroll.c 1.2 + * 6/1/83 (Berkeley) @(#)scroll.c 1.3 */ scroll(win) reg WINDOW *win; { @@ -15,9 +15,9 @@ reg WINDOW *win; { if (!win->_scroll) return ERR; temp = win->_y[0]; - for (i = 0; i < win->_maxy - 2; i++) - win->_y[i] = win->_y[i+1]; - for (sp = temp; sp - temp < win->_maxx; ) + for (i = 1; i < win->_maxy; i++) + win->_y[i - 1] = win->_y[i]; + for (sp = temp; sp < &temp[win->_maxx]; ) *sp++ = ' '; win->_y[win->_maxy - 1] = temp; win->_cury--; @@ -33,5 +33,6 @@ reg WINDOW *win; { else fprintf(outf, "SCROLL: win [0%o] != curscr [0%o]\n",win,curscr); # endif + touchwin(win); return OK; }