--- rxvt-unicode/src/screen.C 2011/02/01 00:41:01 1.368 +++ rxvt-unicode/src/screen.C 2011/02/09 23:07:18 1.371 @@ -40,8 +40,6 @@ } /* ------------------------------------------------------------------------- */ -#define PROP_SIZE 256*1024 -#define PASTE_SIZE 32768 #define TABSIZE 8 /* default tab size */ /* ------------------------------------------------------------------------- * @@ -2746,9 +2744,6 @@ { int selnum = selection_type & Sel_whereMask; - if (selnum == Sel_direct) - selection_type = 0; - if ((selection_type & Sel_CompoundText)) { selection_type = 0; @@ -2767,8 +2762,9 @@ unsigned long bytes_after; XTextProperty ct; + // length == (2^31 - 1) / 4, as gdk if (XGetWindowProperty (dpy, win, prop, - 0, PROP_SIZE / 4, + 0, 0x1fffffff, delete_prop, AnyPropertyType, &ct.encoding, &ct.format, &ct.nitems, &bytes_after, @@ -2781,27 +2777,6 @@ if (ct.encoding == None) goto bailout; - if (bytes_after) - { - // fetch and append remaining data - XTextProperty ct2; - - if (XGetWindowProperty (dpy, win, prop, - ct.nitems / 4, (bytes_after + 3) / 4, - delete_prop, AnyPropertyType, - &ct2.encoding, &ct2.format, - &ct2.nitems, &bytes_after, - &ct2.value) != Success) - goto bailout; - - // realloc should be compatible to XFree, here, and elsewhere, too - ct.value = (unsigned char *)rxvt_realloc (ct.value, ct.nitems + ct2.nitems + 1); - memcpy (ct.value + ct.nitems, ct2.value, ct2.nitems + 1); - ct.nitems += ct2.nitems; - - XFree (ct2.value); - } - if (ct.value == 0) goto bailout; @@ -2905,6 +2880,7 @@ incr_buf_size = 0; free (incr_buf); + incr_buf = 0; rxvt_warn ("data loss: timeout on INCR selection paste, ignoring.\n"); }