bug fix from arnold
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Fri, 24 May 1985 06:41:56 +0000 (22:41 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Fri, 24 May 1985 06:41:56 +0000 (22:41 -0800)
SCCS-vsn: lib/libcurses/scroll.c 1.6

usr/src/lib/libcurses/scroll.c

index 68b5869..afc6645 100644 (file)
@@ -3,39 +3,31 @@
 /*
  *     This routine scrolls the window up a line.
  *
 /*
  *     This routine scrolls the window up a line.
  *
- * @(#)scroll.c        1.5 (Berkeley) %G%
+ * @(#)scroll.c        1.6 (Berkeley) %G%
  */
 scroll(win)
  */
 scroll(win)
-reg WINDOW     *win; {
+register  WINDOW       *win;
+{
+       register int    oy, ox;
 
 
-       reg char        *sp;
-       reg int         i;
-       reg char        *temp;
+# ifdef DEBUG
+       fprintf(outf, "SCROLL(%0.2o)\n", win);
+# endif
 
        if (!win->_scroll)
                return ERR;
 
        if (!win->_scroll)
                return ERR;
-       temp = win->_y[0];
-       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;
+
+       getyx(win, oy, ox);
+       wmove(win, 0, 0);
+       wdeleteln(win);
+       wmove(win, oy, ox);
+
        if (win == curscr) {
                _putchar('\n');
                if (!NONL)
                        win->_curx = 0;
 # ifdef DEBUG
                fprintf(outf, "SCROLL: win == curscr\n");
        if (win == curscr) {
                _putchar('\n');
                if (!NONL)
                        win->_curx = 0;
 # ifdef DEBUG
                fprintf(outf, "SCROLL: win == curscr\n");
-               fflush(outf);
-# endif
-       } else {
-               if(win->_cury-- <= 0)
-                       win->_cury = 0;
-# ifdef DEBUG
-               fprintf(outf, "SCROLL: win [0%o] != curscr [0%o]\n",win,curscr);
-               fflush(outf);
 # endif
        }
 # endif
        }
-       touchwin(win);
-       return OK;
 }
 }