remove spurious i_un.
[unix-history] / usr / src / lib / libcurses / refresh.c
index 110efba..e20b2b1 100644 (file)
@@ -2,7 +2,7 @@
  * make the current screen look like "win" over the area coverd by
  * win.
  *
  * make the current screen look like "win" over the area coverd by
  * win.
  *
- * %G% (Berkeley) @(#)refresh.c        1.2
+ * %G% (Berkeley) @(#)refresh.c        1.5
  */
 
 # include      "curses.ext"
  */
 
 # include      "curses.ext"
@@ -47,11 +47,10 @@ reg WINDOW  *win;
        if (win->_clear || curscr->_clear || curwin) {
                if ((win->_flags & _FULLWIN) || curscr->_clear) {
                        _puts(CL);
        if (win->_clear || curscr->_clear || curwin) {
                if ((win->_flags & _FULLWIN) || curscr->_clear) {
                        _puts(CL);
-                       if (!curwin) {
-                               curscr->_curx = curscr->_cury = 0;
-                               curscr->_clear = FALSE;
+                       ly = lx = curscr->_curx = curscr->_cury = 0;
+                       curscr->_clear = FALSE;
+                       if (!curwin)
                                werase(curscr);
                                werase(curscr);
-                       }
                        touchwin(win);
                }
                win->_clear = FALSE;
                        touchwin(win);
                }
                win->_clear = FALSE;
@@ -178,12 +177,12 @@ short             wy;
                                        }
                                }
                                wx++;
                                        }
                                }
                                wx++;
-                               if (wx >= win->_maxx && wy == win->_maxy)
+                               if (wx >= win->_maxx && wy == win->_maxy - 1)
                                        if (win->_scroll) {
                                            if ((win->_flags&(_ENDLINE|_STANDOUT)) == (_ENDLINE|_STANDOUT))
                                                if (!MS) {
                                        if (win->_scroll) {
                                            if ((win->_flags&(_ENDLINE|_STANDOUT)) == (_ENDLINE|_STANDOUT))
                                                if (!MS) {
-                                                       _puts(SE);
-                                                       win->_flags &= ~_STANDOUT;
+                                                   _puts(SE);
+                                                   win->_flags &= ~_STANDOUT;
                                                }
                                            if (!curwin)
                                                putchar((*csp = *nsp) & 0177);
                                                }
                                            if (!curwin)
                                                putchar((*csp = *nsp) & 0177);
@@ -210,6 +209,10 @@ short              wy;
                                }
                                nsp++;
                        }
                                }
                                nsp++;
                        }
+                       if (!MS && (*nsp & _STANDOUT)  && (*csp & _STANDOUT)) {
+                               _puts(SE);
+                               win->_flags &= ~_STANDOUT;
+                       }
 # ifdef DEBUG
                        fprintf(outf, "MAKECH: 2: wx = %d, lx = %d\n", wx, lx);
 # endif        
 # ifdef DEBUG
                        fprintf(outf, "MAKECH: 2: wx = %d, lx = %d\n", wx, lx);
 # endif