Put the line-wrap check back under STATE_INIT. It was causing some display
authoraaron <aaron@openbsd.org>
Sun, 9 Apr 2000 20:21:30 +0000 (20:21 +0000)
committeraaron <aaron@openbsd.org>
Sun, 9 Apr 2000 20:21:30 +0000 (20:21 +0000)
problems in some (curses?) applications, i.e., sniffit.

sys/arch/i386/isa/pcvt/pcvt_out.c

index a0dfa0e..0b209a9 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pcvt_out.c,v 1.20 2000/04/02 00:03:11 aaron Exp $     */
+/*     $OpenBSD: pcvt_out.c,v 1.21 2000/04/09 20:21:30 aaron Exp $     */
 
 /*
  * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
@@ -352,22 +352,24 @@ sput (u_char *s, U_char kernel, int len, int page)
 
        /* char range 0x20...0xff processing depends on current state */
 
-               if (svsp->lastchar && svsp->m_awm && svsp->lastrow == svsp->row)
-               {
-                       svsp->cur_offset++;
-                       svsp->col = 0;
-                       svsp->lastchar = 0;
-                       if (check_scrollback(svsp)) {
-                               bcopy(svsp->Crtat + svsp->cur_offset -
-                                     svsp->maxcol, svsp->Scrollback +
-                                     (svsp->scr_offset * svsp->maxcol),
-                                     svsp->maxcol * CHR);
-                       }
-                       check_scroll(svsp);
-               }
 
                switch(svsp->state) {
                case STATE_INIT:
+                       if (svsp->lastchar && svsp->m_awm &&
+                           (svsp->lastrow == svsp->row))
+                       {
+                               svsp->cur_offset++;
+                               svsp->col = 0;
+                               svsp->lastchar = 0;
+                               if (check_scrollback(svsp)) {
+                                       bcopy(svsp->Crtat + svsp->cur_offset -
+                                           svsp->maxcol, svsp->Scrollback +
+                                           (svsp->scr_offset * svsp->maxcol),
+                                           svsp->maxcol * CHR);
+                               }
+                               check_scroll(svsp);
+                       }
+
                        if(svsp->irm)
                                bcopy((svsp->Crtat + svsp->cur_offset),
                                    (svsp->Crtat + svsp->cur_offset) + 1,