--- rxvt-unicode/src/screen.C 2004/12/13 01:29:03 1.148 +++ rxvt-unicode/src/screen.C 2005/01/14 17:15:26 1.153 @@ -296,7 +296,6 @@ /* we have fewer rows so fix up cursor position */ MIN_IT (screen.cur.row, (int32_t)nrow - 1); - MIN_IT (swap.cur.row, (int32_t)nrow - 1); scr_reset_realloc (); /* realloc _last_ */ } @@ -339,11 +338,9 @@ } #ifdef DEBUG_STRICT assert (screen.cur.row < TermWin.nrow); - assert (swap.cur.row < TermWin.nrow); #else /* drive with your eyes closed */ MIN_IT (screen.cur.row, nrow - 1); - MIN_IT (swap.cur.row, nrow - 1); #endif TermWin.ncol = ncol; // save b/c scr_blank_screen_mem uses this } @@ -396,7 +393,6 @@ } MIN_IT (screen.cur.col, (int16_t)ncol - 1); - MIN_IT (swap.cur.col, (int16_t)ncol - 1); delete talloc; talloc = ta; delete ralloc; ralloc = ra; @@ -568,19 +564,14 @@ selection_check (2); /* check for boundary cross */ - SWAP_IT (current_screen, scrn, int); + i = current_screen; current_screen = scrn; scrn = i; SWAP_IT (screen.cur.row, swap.cur.row, int16_t); SWAP_IT (screen.cur.col, swap.cur.col, int16_t); -# ifdef DEBUG_STRICT - assert (screen.cur.row >= 0 && screen.cur.row < prev_nrow); - assert (screen.cur.col >= 0 && screen.cur.col < prev_ncol); -# else /* drive with your eyes closed */ MAX_IT (screen.cur.row, 0); MIN_IT (screen.cur.row, (int32_t)prev_nrow - 1); MAX_IT (screen.cur.col, 0); MIN_IT (screen.cur.col, (int32_t)prev_ncol - 1); -# endif #if NSCREENS if (options & Opt_secondaryScreen) @@ -2402,7 +2393,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 +2655,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 +2702,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 +2719,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;