=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** src/usr.bin/tmux/window-copy.c 2009/08/21 07:33:58 1.25 --- src/usr.bin/tmux/window-copy.c 2009/09/07 18:50:45 1.26 *************** *** 1,4 **** ! /* $OpenBSD: window-copy.c,v 1.25 2009/08/21 07:33:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-copy.c,v 1.26 2009/09/07 18:50:45 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 849,861 **** window_copy_copy_line(wp, &buf, &off, ey, 0, ex); } ! /* Terminate buffer, overwriting final \n. */ ! if (off != 0) ! buf[off - 1] = '\0'; /* Add the buffer to the stack. */ limit = options_get_number(&c->session->options, "buffer-limit"); ! paste_add(&c->session->buffers, buf, limit); } void --- 849,864 ---- window_copy_copy_line(wp, &buf, &off, ey, 0, ex); } ! /* Don't bother if no data. */ ! if (off == 0) { ! xfree(buf); ! return; ! } ! off--; /* remove final \n */ /* Add the buffer to the stack. */ limit = options_get_number(&c->session->options, "buffer-limit"); ! paste_add(&c->session->buffers, buf, off, limit); } void