repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 3eb283d943d0f6e483d03acc30cee006b94a70e6:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 3eb283d943d0f6e483d03acc30cee006b94a70e6
Author: Emanuele Giaquinta 
Date:   Fri Jul 8 20:54:31 2011 +0000

    Use rxvt_temp_buf to allocate the temporary line objects needed in
    scr_scroll_text rather than allocating more space in row_buf.

diff --git a/src/rxvt.h b/src/rxvt.h
index 98bacb53f667c1f943c98e6c6433ac5621e4fa3d..
index ..dd5811f2cc88a8b35b50bdd7b29d5d56b1207b79 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -983,7 +983,7 @@ struct rxvt_vars : TermWin_t
   XSizeHints      szHint;
   rxvt_color     *pix_colors;
   Cursor          TermWin_cursor;       /* cursor for vt window */
-  line_t         *row_buf;      // all lines, scrollback + terminal, circular, followed by temp_buf
+  line_t         *row_buf;      // all lines, scrollback + terminal, circular
   line_t         *drawn_buf;    // text on screen
   line_t         *swap_buf;     // lines for swap buffer
   char           *tabs;         /* per location: 1 == tab-stop               */
diff --git a/src/screen.C b/src/screen.C
index f9acfb899bb78b7fd65f85bc27bd74e43f9125e8..
index ..3af6303a6b62eb5258c4b7436a8d7066e7e5a141 100644
--- a/src/screen.C
+++ b/src/screen.C
@@ -205,7 +205,7 @@ rxvt_term::scr_reset ()
       talloc = new rxvt_salloc (ncol * sizeof (text_t));
       ralloc = new rxvt_salloc (ncol * sizeof (rend_t));

-      row_buf   = (line_t *)rxvt_calloc (total_rows + nrow, sizeof (line_t));
+      row_buf   = (line_t *)rxvt_calloc (total_rows       , sizeof (line_t));
       drawn_buf = (line_t *)rxvt_calloc (nrow             , sizeof (line_t));
       swap_buf  = (line_t *)rxvt_calloc (nrow             , sizeof (line_t));

@@ -277,7 +277,7 @@ rxvt_term::scr_reset ()
         }

       line_t *old_buf = row_buf;
-      row_buf = (line_t *)rxvt_calloc (total_rows + nrow, sizeof (line_t));
+      row_buf = (line_t *)rxvt_calloc (total_rows, sizeof (line_t));

       int p    = MOD (term_start + prev_nrow, prev_total_rows);  // previous row
       int pend = MOD (term_start + top_row  , prev_total_rows);
@@ -748,7 +748,7 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) NOTHROW

       min_it (count, rows);

-      line_t *temp_buf = row_buf + total_rows;
+      line_t *temp_buf = rxvt_temp_buf (rows);

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

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