make it return ERR for illegal scroll type things
authorKen Arnold <arnold@ucbvax.Berkeley.EDU>
Fri, 17 Apr 1981 15:44:35 +0000 (07:44 -0800)
committerKen Arnold <arnold@ucbvax.Berkeley.EDU>
Fri, 17 Apr 1981 15:44:35 +0000 (07:44 -0800)
SCCS-vsn: lib/libcurses/insertln.c 1.4

usr/src/lib/libcurses/insertln.c

index 6c4a074..88e62f7 100644 (file)
@@ -4,7 +4,7 @@
  *     This routine performs an insert-line on the window, leaving
  * (_cury,_curx) unchanged.
  *
  *     This routine performs an insert-line on the window, leaving
  * (_cury,_curx) unchanged.
  *
- * %G% (Berkeley) @(#)insertln.c       1.3
+ * %G% (Berkeley) @(#)insertln.c       1.4
  */
 winsertln(win)
 reg WINDOW     *win; {
  */
 winsertln(win)
 reg WINDOW     *win; {
@@ -24,4 +24,13 @@ reg WINDOW   *win; {
        for (end = &temp[win->_maxx]; temp < end; )
                *temp++ = ' ';
        win->_y[win->_cury] = temp - win->_maxx;
        for (end = &temp[win->_maxx]; temp < end; )
                *temp++ = ' ';
        win->_y[win->_cury] = temp - win->_maxx;
+       if (win->_cury == LINES - 1 && win->_y[LINES-1][COLS-1] != ' ')
+               if (win->_scroll) {
+                       wrefresh(win);
+                       scroll(win);
+                       win->_cury--;
+               }
+               else
+                       return ERR;
+       return OK;
 }
 }