mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-19 09:52:06 +02:00
Give each paste buffer a size member instead of requiring them to be
zero-terminated.
This commit is contained in:
@@ -849,13 +849,16 @@ window_copy_copy_selection(struct window_pane *wp, struct client *c)
|
||||
window_copy_copy_line(wp, &buf, &off, ey, 0, ex);
|
||||
}
|
||||
|
||||
/* Terminate buffer, overwriting final \n. */
|
||||
if (off != 0)
|
||||
buf[off - 1] = '\0';
|
||||
/* 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, limit);
|
||||
paste_add(&c->session->buffers, buf, off, limit);
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user