new copyright notice
[unix-history] / usr / src / lib / libcurses / erase.c
index 61ea57d..e896211 100644 (file)
@@ -1,9 +1,19 @@
+/*
+ * Copyright (c) 1981 Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)erase.c    5.4 (Berkeley) %G%";
+#endif /* not lint */
+
 # include      "curses.ext"
 
 /*
  *     This routine erases everything on the window.
  *
 # include      "curses.ext"
 
 /*
  *     This routine erases everything on the window.
  *
- * %G% (Berkeley) @(#)erase.c  1.1
  */
 werase(win)
 reg WINDOW     *win; {
  */
 werase(win)
 reg WINDOW     *win; {
@@ -12,6 +22,9 @@ reg WINDOW    *win; {
        reg char        *sp, *end, *start, *maxx;
        reg int         minx;
 
        reg char        *sp, *end, *start, *maxx;
        reg int         minx;
 
+# ifdef DEBUG
+       fprintf(outf, "WERASE(%0.2o)\n", win);
+# endif
        for (y = 0; y < win->_maxy; y++) {
                minx = _NOCHANGE;
                start = win->_y[y];
        for (y = 0; y < win->_maxy; y++) {
                minx = _NOCHANGE;
                start = win->_y[y];
@@ -23,13 +36,8 @@ reg WINDOW   *win; {
                                        minx = sp - start;
                                *sp = ' ';
                        }
                                        minx = sp - start;
                                *sp = ' ';
                        }
-               if (minx != _NOCHANGE) {
-                       if (win->_firstch[y] > minx
-                            || win->_firstch[y] == _NOCHANGE)
-                               win->_firstch[y] = minx;
-                       if (win->_lastch[y] < maxx - win->_y[y])
-                               win->_lastch[y] = maxx - win->_y[y];
-               }
+               if (minx != _NOCHANGE)
+                       touchline(win, y, minx, maxx - win->_y[y]);
        }
        win->_curx = win->_cury = 0;
 }
        }
        win->_curx = win->_cury = 0;
 }