--- rxvt-unicode/src/screen.C 2004/12/13 01:29:03 1.148 +++ rxvt-unicode/src/screen.C 2004/12/15 00:53:23 1.151 @@ -2402,7 +2402,13 @@ if (rend & RS_Uline && font->descent > 1 && fore != back) { - XSetForeground (display->display, TermWin.gc, pix_colors[fore]); +#if ENABLE_FRILLS + if (ISSET_PIXCOLOR (Color_underline)) + XSetForeground (display->display, TermWin.gc, pix_colors[Color_underline]); + else +#endif + XSetForeground (display->display, TermWin.gc, pix_colors[fore]); + XDrawLine (display->display, drawBuffer, TermWin.gc, xpixel, ypixel + font->ascent + 1, xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1); @@ -2658,25 +2664,14 @@ * 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); } /* ------------------------------------------------------------------------- */ @@ -2716,7 +2711,7 @@ XTextProperty ct; if (XGetWindowProperty (display->display, win, prop, - 0, (long)(PROP_SIZE / 4), + 0, PROP_SIZE / 4, delete_prop, AnyPropertyType, &ct.encoding, &ct.format, &ct.nitems, &bytes_after, @@ -2733,25 +2728,22 @@ { // fetch and append remaining data XTextProperty ct2; - unsigned long bytes_after2; if (XGetWindowProperty (display->display, win, prop, - ct.nitems / 4, (long) (bytes_after + 3) / 4, + ct.nitems / 4, (bytes_after + 3) / 4, delete_prop, AnyPropertyType, &ct2.encoding, &ct2.format, - &ct2.nitems, &bytes_after2, + &ct2.nitems, &bytes_after, &ct2.value) != Success) goto bailout; // realloc should be compatible to XFree, here, and elsewhere, too - ct.value = (unsigned char *)realloc (ct.value, ct.nitems + bytes_after); - memcpy (ct.value + ct.nitems, ct2.value, ct2.nitems); + ct.value = (unsigned char *)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); } - else if (delete_prop) - XDeleteProperty (display->display, win, prop); if (ct.value == 0) goto bailout;