repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 8c1a00054aa18641e6af8ffa35d1c9ed8718844b:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 8c1a00054aa18641e6af8ffa35d1c9ed8718844b
Author: Marc Lehmann 
Date:   Thu Jul 7 23:15:44 2011 +0000

    *** empty log message ***

diff --git a/src/screen.C b/src/screen.C
index 35ac7f3333264702eeae3251e2d57935a1b00296..
index ..9e412c661dca7e65179818602f8f127e8fc69fe0 100644
--- a/src/screen.C
+++ b/src/screen.C
@@ -633,10 +633,6 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) NOTHROW
   if (count == 0 || (row1 > row2))
     return 0;

-  int rows = row2 - row1 + 1;
-
-  min_it (count, rows);
-
   want_refresh = 1;
   num_scr += count;

@@ -644,6 +640,8 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) NOTHROW
       && row1 == 0
       && (current_screen == PRIMARY || option (Opt_secondaryScroll)))
     {
+      min_it (count, row2 - total_rows);
+
       top_row = max (top_row - count, -saveLines);

       // scroll everything up 'count' lines
@@ -661,7 +659,7 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) NOTHROW
         {
           line_t &l = ROW(nrow - 1 - i);

-          // optimize if already cleared, can be significant on slow machines
+          // optimise if already cleared, can be significant on slow machines
           // could be rolled into scr_blank_screen_mem
           if (l.r && l.l < ncol - 1 && !((l.r[l.l + 1] ^ rstyle) & (RS_fgMask | RS_bgMask)))
             {
@@ -738,6 +736,10 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) NOTHROW
       // use a simple and robust scrolling algorithm, this
       // part of scr_scroll_text is not time-critical.

+      int rows = row2 - row1 + 1;
+
+      min_it (count, rows);
+
       line_t *temp_buf = row_buf + total_rows;

       for (int row = 0; row < rows; row++)

-----END OF PAGE-----