From 7f6edf823a1e30c9041ad5d86ea964a2d1f11311 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 13 Dec 2004 19:16:36 +0000 Subject: [PATCH] *** empty log message *** --- src/main.C | 1 + src/rxvt.h | 3 ++- src/screen.C | 21 +++++---------------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/main.C b/src/main.C index 942089fa..a570ffe4 100644 --- a/src/main.C +++ b/src/main.C @@ -261,6 +261,7 @@ rxvt_term::~rxvt_term () free (env_term); free (env_colorfgbg); free (locale); + free (v_buffer); free (incr_buf); delete envv; diff --git a/src/rxvt.h b/src/rxvt.h index 8d857f9b..525ee3f9 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -1202,7 +1202,8 @@ struct rxvt_term : zero_initialized, rxvt_vars { # endif #endif - void paste (const unsigned char *data, unsigned int len); + // modifies first argument(!) + void paste (unsigned char *data, unsigned int len); void flush (); diff --git a/src/screen.C b/src/screen.C index 58368982..116c264c 100644 --- a/src/screen.C +++ b/src/screen.C @@ -2658,25 +2658,14 @@ rxvt_term::selection_check (int check_more) * Paste a selection direct to the command fd */ void -rxvt_term::paste (const unsigned char *data, unsigned int len) +rxvt_term::paste (unsigned char *data, unsigned int len) { - unsigned int i, j, n; - unsigned char *ds = (unsigned char *)rxvt_malloc (PASTE_SIZE); - /* convert normal newline chars into common keyboard Return key sequence */ - for (i = 0; i < len; i += PASTE_SIZE) - { - n = min (len - i, PASTE_SIZE); - memcpy (ds, data + i, n); - - for (j = 0; j < n; j++) - if (ds[j] == C0_LF) - ds[j] = C0_CR; - - tt_write (ds, (int)n); - } + for (unsigned int i = 0; i < len; i++) + if (data[i] == C0_LF) + data[i] = C0_CR; - free (ds); + tt_write (data, len); } /* ------------------------------------------------------------------------- */ -- 2.34.1