=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** src/usr.bin/tmux/window-copy.c 2009/10/20 21:35:25 1.31 --- src/usr.bin/tmux/window-copy.c 2009/11/18 17:02:17 1.32 *************** *** 1,4 **** ! /* $OpenBSD: window-copy.c,v 1.31 2009/10/20 21:35:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-copy.c,v 1.32 2009/11/18 17:02:17 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 486,491 **** --- 486,492 ---- { const struct grid_cell *gc, *sgc; const struct grid_utf8 *gu, *sgu; + size_t size; gc = grid_peek_cell(gd, px, py); sgc = grid_peek_cell(sgd, spx, 0); *************** *** 496,502 **** if (gc->flags & GRID_FLAG_UTF8) { gu = grid_peek_utf8(gd, px, py); sgu = grid_peek_utf8(sgd, spx, 0); ! if (memcmp(gu->data, sgu->data, UTF8_SIZE) == 0) return (1); } else { if (gc->data == sgc->data) --- 497,503 ---- if (gc->flags & GRID_FLAG_UTF8) { gu = grid_peek_utf8(gd, px, py); sgu = grid_peek_utf8(sgd, spx, 0); ! if (grid_utf8_compare(gu, sgu)) return (1); } else { if (gc->data == sgc->data) *************** *** 895,901 **** const struct grid_cell *gc; const struct grid_utf8 *gu; struct grid_line *gl; ! u_int i, j, xx, wrapped = 0; if (sx > ex) return; --- 896,903 ---- const struct grid_cell *gc; const struct grid_utf8 *gu; struct grid_line *gl; ! u_int i, xx, wrapped = 0; ! size_t size; if (sx > ex) return; *************** *** 928,939 **** (*buf)[(*off)++] = gc->data; } else { gu = grid_peek_utf8(gd, i, sy); ! *buf = xrealloc(*buf, 1, (*off) + UTF8_SIZE); ! for (j = 0; j < UTF8_SIZE; j++) { ! if (gu->data[j] == 0xff) ! break; ! (*buf)[(*off)++] = gu->data[j]; ! } } } } --- 930,938 ---- (*buf)[(*off)++] = gc->data; } else { gu = grid_peek_utf8(gd, i, sy); ! size = grid_utf8_size(gu); ! *buf = xrealloc(*buf, 1, (*off) + size); ! *off += grid_utf8_copy(gu, *buf + *off, size); } } }