ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/screen.C
(Generate patch)

Comparing rxvt-unicode/src/screen.C (file contents):
Revision 1.368 by sf-exg, Tue Feb 1 00:41:01 2011 UTC vs.
Revision 1.369 by sf-exg, Sun Feb 6 11:42:03 2011 UTC

38 while (len--) 38 while (len--)
39 *start++ = value; 39 *start++ = value;
40} 40}
41 41
42/* ------------------------------------------------------------------------- */ 42/* ------------------------------------------------------------------------- */
43#define PROP_SIZE 256*1024
44#define PASTE_SIZE 32768
45#define TABSIZE 8 /* default tab size */ 43#define TABSIZE 8 /* default tab size */
46 44
47/* ------------------------------------------------------------------------- * 45/* ------------------------------------------------------------------------- *
48 * GENERAL SCREEN AND SELECTION UPDATE ROUTINES * 46 * GENERAL SCREEN AND SELECTION UPDATE ROUTINES *
49 * ------------------------------------------------------------------------- */ 47 * ------------------------------------------------------------------------- */
2765 } 2763 }
2766 2764
2767 unsigned long bytes_after; 2765 unsigned long bytes_after;
2768 XTextProperty ct; 2766 XTextProperty ct;
2769 2767
2768 // length == (2^31 - 1) / 4, as gdk
2770 if (XGetWindowProperty (dpy, win, prop, 2769 if (XGetWindowProperty (dpy, win, prop,
2771 0, PROP_SIZE / 4, 2770 0, 0x1fffffff,
2772 delete_prop, AnyPropertyType, 2771 delete_prop, AnyPropertyType,
2773 &ct.encoding, &ct.format, 2772 &ct.encoding, &ct.format,
2774 &ct.nitems, &bytes_after, 2773 &ct.nitems, &bytes_after,
2775 &ct.value) != Success) 2774 &ct.value) != Success)
2776 { 2775 {
2778 goto bailout; 2777 goto bailout;
2779 } 2778 }
2780 2779
2781 if (ct.encoding == None) 2780 if (ct.encoding == None)
2782 goto bailout; 2781 goto bailout;
2783
2784 if (bytes_after)
2785 {
2786 // fetch and append remaining data
2787 XTextProperty ct2;
2788
2789 if (XGetWindowProperty (dpy, win, prop,
2790 ct.nitems / 4, (bytes_after + 3) / 4,
2791 delete_prop, AnyPropertyType,
2792 &ct2.encoding, &ct2.format,
2793 &ct2.nitems, &bytes_after,
2794 &ct2.value) != Success)
2795 goto bailout;
2796
2797 // realloc should be compatible to XFree, here, and elsewhere, too
2798 ct.value = (unsigned char *)rxvt_realloc (ct.value, ct.nitems + ct2.nitems + 1);
2799 memcpy (ct.value + ct.nitems, ct2.value, ct2.nitems + 1);
2800 ct.nitems += ct2.nitems;
2801
2802 XFree (ct2.value);
2803 }
2804 2782
2805 if (ct.value == 0) 2783 if (ct.value == 0)
2806 goto bailout; 2784 goto bailout;
2807 2785
2808 if (ct.encoding == xa[XA_INCR]) 2786 if (ct.encoding == xa[XA_INCR])

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines