--- rxvt-unicode/src/screen.C 2011/05/30 18:39:04 1.384 +++ rxvt-unicode/src/screen.C 2011/07/06 00:40:10 1.385 @@ -633,6 +633,10 @@ if (count == 0 || (row1 > row2)) return 0; + int rows = row2 - row1 + 1; + + min_it (count, rows); + want_refresh = 1; num_scr += count; @@ -734,10 +738,6 @@ // 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++)