diff options
-rw-r--r-- | usr.bin/tmux/cmd-capture-pane.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-choose-buffer.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-delete-buffer.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-list-buffers.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-load-buffer.c | 10 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-paste-buffer.c | 10 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-save-buffer.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-set-buffer.c | 10 | ||||
-rw-r--r-- | usr.bin/tmux/input-keys.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/paste.c | 52 | ||||
-rw-r--r-- | usr.bin/tmux/server.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/status.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 18 | ||||
-rw-r--r-- | usr.bin/tmux/window-copy.c | 16 |
14 files changed, 77 insertions, 80 deletions
diff --git a/usr.bin/tmux/cmd-capture-pane.c b/usr.bin/tmux/cmd-capture-pane.c index d574edc7657..68f17aa15ff 100644 --- a/usr.bin/tmux/cmd-capture-pane.c +++ b/usr.bin/tmux/cmd-capture-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-capture-pane.c,v 1.25 2013/10/10 12:00:18 nicm Exp $ */ +/* $OpenBSD: cmd-capture-pane.c,v 1.26 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2009 Jonathan Alvarado <radobobo@users.sourceforge.net> @@ -194,7 +194,7 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq) } else { limit = options_get_number(&global_options, "buffer-limit"); if (!args_has(args, 'b')) { - paste_add(&global_buffers, buf, len, limit); + paste_add(buf, len, limit); return (CMD_RETURN_NORMAL); } @@ -206,7 +206,7 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_ERROR); } - if (paste_replace(&global_buffers, buffer, buf, len) != 0) { + if (paste_replace(buffer, buf, len) != 0) { cmdq_error(cmdq, "no buffer %d", buffer); free(buf); return (CMD_RETURN_ERROR); diff --git a/usr.bin/tmux/cmd-choose-buffer.c b/usr.bin/tmux/cmd-choose-buffer.c index 99ca9020e71..f1327c74b4d 100644 --- a/usr.bin/tmux/cmd-choose-buffer.c +++ b/usr.bin/tmux/cmd-choose-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-choose-buffer.c,v 1.16 2014/04/02 18:12:18 nicm Exp $ */ +/* $OpenBSD: cmd-choose-buffer.c,v 1.17 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2010 Nicholas Marriott <nicm@users.sourceforge.net> @@ -63,7 +63,7 @@ cmd_choose_buffer_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_ERROR); utf8flag = options_get_number(&wl->window->options, "utf8"); - if (paste_get_top(&global_buffers) == NULL) + if (paste_get_top() == NULL) return (CMD_RETURN_NORMAL); if (window_pane_set_mode(wl->window->active, &window_choose_mode) != 0) @@ -75,7 +75,7 @@ cmd_choose_buffer_exec(struct cmd *self, struct cmd_q *cmdq) action = xstrdup("paste-buffer -b '%%'"); idx = 0; - while ((pb = paste_walk_stack(&global_buffers, &idx)) != NULL) { + while ((pb = paste_walk_stack(&idx)) != NULL) { cdata = window_choose_data_create(TREE_OTHER, c, c->session); cdata->idx = idx - 1; diff --git a/usr.bin/tmux/cmd-delete-buffer.c b/usr.bin/tmux/cmd-delete-buffer.c index 701900a9f6e..f5e4e701da5 100644 --- a/usr.bin/tmux/cmd-delete-buffer.c +++ b/usr.bin/tmux/cmd-delete-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-delete-buffer.c,v 1.10 2013/10/10 12:00:19 nicm Exp $ */ +/* $OpenBSD: cmd-delete-buffer.c,v 1.11 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -45,7 +45,7 @@ cmd_delete_buffer_exec(struct cmd *self, struct cmd_q *cmdq) int buffer; if (!args_has(args, 'b')) { - paste_free_top(&global_buffers); + paste_free_top(); return (CMD_RETURN_NORMAL); } @@ -56,7 +56,7 @@ cmd_delete_buffer_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_ERROR); } - if (paste_free_index(&global_buffers, buffer) != 0) { + if (paste_free_index(buffer) != 0) { cmdq_error(cmdq, "no buffer %d", buffer); return (CMD_RETURN_ERROR); } diff --git a/usr.bin/tmux/cmd-list-buffers.c b/usr.bin/tmux/cmd-list-buffers.c index 68283359be5..dc86bc7f1b3 100644 --- a/usr.bin/tmux/cmd-list-buffers.c +++ b/usr.bin/tmux/cmd-list-buffers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-buffers.c,v 1.19 2014/04/02 18:12:18 nicm Exp $ */ +/* $OpenBSD: cmd-list-buffers.c,v 1.20 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -52,7 +52,7 @@ cmd_list_buffers_exec(unused struct cmd *self, struct cmd_q *cmdq) template = LIST_BUFFERS_TEMPLATE; idx = 0; - while ((pb = paste_walk_stack(&global_buffers, &idx)) != NULL) { + while ((pb = paste_walk_stack(&idx)) != NULL) { ft = format_create(); format_add(ft, "line", "%u", idx - 1); format_paste_buffer(ft, pb, 0); diff --git a/usr.bin/tmux/cmd-load-buffer.c b/usr.bin/tmux/cmd-load-buffer.c index e98e54a8f42..32ba813dceb 100644 --- a/usr.bin/tmux/cmd-load-buffer.c +++ b/usr.bin/tmux/cmd-load-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-load-buffer.c,v 1.27 2014/02/17 23:07:03 nicm Exp $ */ +/* $OpenBSD: cmd-load-buffer.c,v 1.28 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -119,10 +119,10 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_q *cmdq) limit = options_get_number(&global_options, "buffer-limit"); if (buffer == -1) { - paste_add(&global_buffers, pdata, psize, limit); + paste_add(pdata, psize, limit); return (CMD_RETURN_NORMAL); } - if (paste_replace(&global_buffers, buffer, pdata, psize) != 0) { + if (paste_replace(buffer, pdata, psize) != 0) { cmdq_error(cmdq, "no buffer %d", buffer); free(pdata); return (CMD_RETURN_ERROR); @@ -164,8 +164,8 @@ cmd_load_buffer_callback(struct client *c, int closed, void *data) limit = options_get_number(&global_options, "buffer-limit"); if (*buffer == -1) - paste_add(&global_buffers, pdata, psize, limit); - else if (paste_replace(&global_buffers, *buffer, pdata, psize) != 0) { + paste_add(pdata, psize, limit); + else if (paste_replace(*buffer, pdata, psize) != 0) { /* No context so can't use server_client_msg_error. */ evbuffer_add_printf(c->stderr_data, "no buffer %d\n", *buffer); server_push_stderr(c); diff --git a/usr.bin/tmux/cmd-paste-buffer.c b/usr.bin/tmux/cmd-paste-buffer.c index 664485ceaff..fbb0790f8f8 100644 --- a/usr.bin/tmux/cmd-paste-buffer.c +++ b/usr.bin/tmux/cmd-paste-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-paste-buffer.c,v 1.23 2013/10/10 12:00:21 nicm Exp $ */ +/* $OpenBSD: cmd-paste-buffer.c,v 1.24 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -69,9 +69,9 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_q *cmdq) } if (buffer == -1) - pb = paste_get_top(&global_buffers); + pb = paste_get_top(); else { - pb = paste_get_index(&global_buffers, buffer); + pb = paste_get_index(buffer); if (pb == NULL) { cmdq_error(cmdq, "no buffer %d", buffer); return (CMD_RETURN_ERROR); @@ -93,9 +93,9 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_q *cmdq) /* Delete the buffer if -d. */ if (args_has(args, 'd')) { if (buffer == -1) - paste_free_top(&global_buffers); + paste_free_top(); else - paste_free_index(&global_buffers, buffer); + paste_free_index(buffer); } return (CMD_RETURN_NORMAL); diff --git a/usr.bin/tmux/cmd-save-buffer.c b/usr.bin/tmux/cmd-save-buffer.c index 1e9b11825a2..d5bd640530c 100644 --- a/usr.bin/tmux/cmd-save-buffer.c +++ b/usr.bin/tmux/cmd-save-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-save-buffer.c,v 1.23 2014/04/16 23:05:38 nicm Exp $ */ +/* $OpenBSD: cmd-save-buffer.c,v 1.24 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -66,7 +66,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_q *cmdq) FILE *f; if (!args_has(args, 'b')) { - if ((pb = paste_get_top(&global_buffers)) == NULL) { + if ((pb = paste_get_top()) == NULL) { cmdq_error(cmdq, "no buffers"); return (CMD_RETURN_ERROR); } @@ -78,7 +78,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_ERROR); } - pb = paste_get_index(&global_buffers, buffer); + pb = paste_get_index(buffer); if (pb == NULL) { cmdq_error(cmdq, "no buffer %d", buffer); return (CMD_RETURN_ERROR); diff --git a/usr.bin/tmux/cmd-set-buffer.c b/usr.bin/tmux/cmd-set-buffer.c index 6a793f49c89..ca8250c2769 100644 --- a/usr.bin/tmux/cmd-set-buffer.c +++ b/usr.bin/tmux/cmd-set-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-set-buffer.c,v 1.16 2014/03/31 21:43:55 nicm Exp $ */ +/* $OpenBSD: cmd-set-buffer.c,v 1.17 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -66,13 +66,13 @@ cmd_set_buffer_exec(struct cmd *self, struct cmd_q *cmdq) free(cause); return (CMD_RETURN_ERROR); } - pb = paste_get_index(&global_buffers, buffer); + pb = paste_get_index(buffer); if (pb == NULL) { cmdq_error(cmdq, "no buffer %d", buffer); return (CMD_RETURN_ERROR); } } else if (args_has(args, 'a')) { - pb = paste_get_top(&global_buffers); + pb = paste_get_top(); if (pb != NULL) buffer = 0; } @@ -88,9 +88,9 @@ cmd_set_buffer_exec(struct cmd *self, struct cmd_q *cmdq) psize += newsize; if (buffer == -1) - paste_add(&global_buffers, pdata, psize, limit); + paste_add(pdata, psize, limit); else - paste_replace(&global_buffers, buffer, pdata, psize); + paste_replace(buffer, pdata, psize); return (CMD_RETURN_NORMAL); } diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c index 26c1a4d91fe..4362dcad3ba 100644 --- a/usr.bin/tmux/input-keys.c +++ b/usr.bin/tmux/input-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input-keys.c,v 1.35 2014/04/03 08:15:17 nicm Exp $ */ +/* $OpenBSD: input-keys.c,v 1.36 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -240,7 +240,7 @@ input_mouse(struct window_pane *wp, struct session *s, struct mouse_event *m) if (m->button == 1 && (m->event & MOUSE_EVENT_CLICK) && options_get_number(&wp->window->options, "mode-mouse") == 1) { - pb = paste_get_top(&global_buffers); + pb = paste_get_top(); if (pb != NULL) { paste_send_pane(pb, wp, "\r", wp->screen->mode & MODE_BRACKETPASTE); diff --git a/usr.bin/tmux/paste.c b/usr.bin/tmux/paste.c index 8aa385695e4..0390ebf8f99 100644 --- a/usr.bin/tmux/paste.c +++ b/usr.bin/tmux/paste.c @@ -1,4 +1,4 @@ -/* $OpenBSD: paste.c,v 1.17 2014/04/02 18:12:18 nicm Exp $ */ +/* $OpenBSD: paste.c,v 1.18 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -30,46 +30,48 @@ * string! */ +ARRAY_DECL(, struct paste_buffer *) paste_buffers = ARRAY_INITIALIZER; + /* Return each item of the stack in turn. */ struct paste_buffer * -paste_walk_stack(struct paste_stack *ps, u_int *idx) +paste_walk_stack(u_int *idx) { struct paste_buffer *pb; - pb = paste_get_index(ps, *idx); + pb = paste_get_index(*idx); (*idx)++; return (pb); } /* Get the top item on the stack. */ struct paste_buffer * -paste_get_top(struct paste_stack *ps) +paste_get_top(void) { - if (ARRAY_LENGTH(ps) == 0) + if (ARRAY_LENGTH(&paste_buffers) == 0) return (NULL); - return (ARRAY_FIRST(ps)); + return (ARRAY_FIRST(&paste_buffers)); } /* Get an item by its index. */ struct paste_buffer * -paste_get_index(struct paste_stack *ps, u_int idx) +paste_get_index(u_int idx) { - if (idx >= ARRAY_LENGTH(ps)) + if (idx >= ARRAY_LENGTH(&paste_buffers)) return (NULL); - return (ARRAY_ITEM(ps, idx)); + return (ARRAY_ITEM(&paste_buffers, idx)); } /* Free the top item on the stack. */ int -paste_free_top(struct paste_stack *ps) +paste_free_top(void) { struct paste_buffer *pb; - if (ARRAY_LENGTH(ps) == 0) + if (ARRAY_LENGTH(&paste_buffers) == 0) return (-1); - pb = ARRAY_FIRST(ps); - ARRAY_REMOVE(ps, 0); + pb = ARRAY_FIRST(&paste_buffers); + ARRAY_REMOVE(&paste_buffers, 0); free(pb->data); free(pb); @@ -79,15 +81,15 @@ paste_free_top(struct paste_stack *ps) /* Free an item by index. */ int -paste_free_index(struct paste_stack *ps, u_int idx) +paste_free_index(u_int idx) { struct paste_buffer *pb; - if (idx >= ARRAY_LENGTH(ps)) + if (idx >= ARRAY_LENGTH(&paste_buffers)) return (-1); - pb = ARRAY_ITEM(ps, idx); - ARRAY_REMOVE(ps, idx); + pb = ARRAY_ITEM(&paste_buffers, idx); + ARRAY_REMOVE(&paste_buffers, idx); free(pb->data); free(pb); @@ -100,22 +102,22 @@ paste_free_index(struct paste_stack *ps, u_int idx) * that the caller is responsible for allocating data. */ void -paste_add(struct paste_stack *ps, char *data, size_t size, u_int limit) +paste_add(char *data, size_t size, u_int limit) { struct paste_buffer *pb; if (size == 0) return; - while (ARRAY_LENGTH(ps) >= limit) { - pb = ARRAY_LAST(ps); + while (ARRAY_LENGTH(&paste_buffers) >= limit) { + pb = ARRAY_LAST(&paste_buffers); free(pb->data); free(pb); - ARRAY_TRUNC(ps, 1); + ARRAY_TRUNC(&paste_buffers, 1); } pb = xmalloc(sizeof *pb); - ARRAY_INSERT(ps, 0, pb); + ARRAY_INSERT(&paste_buffers, 0, pb); pb->data = data; pb->size = size; @@ -127,7 +129,7 @@ paste_add(struct paste_stack *ps, char *data, size_t size, u_int limit) * allocating data. */ int -paste_replace(struct paste_stack *ps, u_int idx, char *data, size_t size) +paste_replace(u_int idx, char *data, size_t size) { struct paste_buffer *pb; @@ -136,10 +138,10 @@ paste_replace(struct paste_stack *ps, u_int idx, char *data, size_t size) return (0); } - if (idx >= ARRAY_LENGTH(ps)) + if (idx >= ARRAY_LENGTH(&paste_buffers)) return (-1); - pb = ARRAY_ITEM(ps, idx); + pb = ARRAY_ITEM(&paste_buffers, idx); free(pb->data); pb->data = data; diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c index 3924159ae1b..2a7e1431633 100644 --- a/usr.bin/tmux/server.c +++ b/usr.bin/tmux/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.112 2014/04/17 14:45:49 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.113 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -51,8 +51,6 @@ int server_shutdown; struct event server_ev_accept; struct event server_ev_second; -struct paste_stack global_buffers; - int server_create_socket(void); void server_loop(void); int server_should_shutdown(void); @@ -147,7 +145,6 @@ server_start(int lockfd, char *lockfile) RB_INIT(&sessions); RB_INIT(&dead_sessions); TAILQ_INIT(&session_groups); - ARRAY_INIT(&global_buffers); mode_key_init_trees(); key_bindings_init(); utf8_build(); diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c index 2d6b7a90597..7dab624680e 100644 --- a/usr.bin/tmux/status.c +++ b/usr.bin/tmux/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.113 2014/04/17 07:36:45 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.114 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1157,7 +1157,7 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; break; case MODEKEYEDIT_PASTE: - if ((pb = paste_get_top(&global_buffers)) == NULL) + if ((pb = paste_get_top()) == NULL) break; for (n = 0; n < pb->size; n++) { ch = (u_char) pb->data[n]; diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index c40bee1b26d..1ed4f357353 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.456 2014/04/17 15:37:55 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.457 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1037,7 +1037,6 @@ struct paste_buffer { char *data; size_t size; }; -ARRAY_DECL(paste_stack, struct paste_buffer *); /* Environment variable. */ struct environ_entry { @@ -1709,13 +1708,13 @@ void tty_keys_free(struct tty *); int tty_keys_next(struct tty *); /* paste.c */ -struct paste_buffer *paste_walk_stack(struct paste_stack *, u_int *); -struct paste_buffer *paste_get_top(struct paste_stack *); -struct paste_buffer *paste_get_index(struct paste_stack *, u_int); -int paste_free_top(struct paste_stack *); -int paste_free_index(struct paste_stack *, u_int); -void paste_add(struct paste_stack *, char *, size_t, u_int); -int paste_replace(struct paste_stack *, u_int, char *, size_t); +struct paste_buffer *paste_walk_stack(u_int *); +struct paste_buffer *paste_get_top(void); +struct paste_buffer *paste_get_index(u_int); +int paste_free_top(void); +int paste_free_index(u_int); +void paste_add(char *, size_t, u_int); +int paste_replace(u_int, char *, size_t); char *paste_make_sample(struct paste_buffer *, int); void paste_send_pane(struct paste_buffer *, struct window_pane *, const char *, int); @@ -1886,7 +1885,6 @@ const char *key_string_lookup_key(int); /* server.c */ extern struct clients clients; extern struct clients dead_clients; -extern struct paste_stack global_buffers; int server_start(int, char *); void server_update_socket(void); void server_add_accept(int); diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index d82042b8a68..daa32b89529 100644 --- a/usr.bin/tmux/window-copy.c +++ b/usr.bin/tmux/window-copy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.106 2014/04/17 14:45:49 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.107 2014/04/24 09:14:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -776,7 +776,7 @@ window_copy_key_input(struct window_pane *wp, int key) *data->inputstr = '\0'; break; case MODEKEYEDIT_PASTE: - if ((pb = paste_get_top(&global_buffers)) == NULL) + if ((pb = paste_get_top()) == NULL) break; for (n = 0; n < pb->size; n++) { ch = (u_char) pb->data[n]; @@ -1465,8 +1465,8 @@ window_copy_copy_buffer(struct window_pane *wp, int idx, void *buf, size_t len) if (idx == -1) { limit = options_get_number(&global_options, "buffer-limit"); - paste_add(&global_buffers, buf, len, limit); - } else if (paste_replace(&global_buffers, idx, buf, len) != 0) + paste_add(buf, len, limit); + } else if (paste_replace(idx, buf, len) != 0) free(buf); } @@ -1524,13 +1524,13 @@ window_copy_append_selection(struct window_pane *wp, int idx) if (idx == -1) idx = 0; - if (idx == 0 && paste_get_top(&global_buffers) == NULL) { + if (idx == 0 && paste_get_top() == NULL) { limit = options_get_number(&global_options, "buffer-limit"); - paste_add(&global_buffers, buf, len, limit); + paste_add(buf, len, limit); return; } - pb = paste_get_index(&global_buffers, idx); + pb = paste_get_index(idx); if (pb != NULL) { buf = xrealloc(buf, 1, len + pb->size); memmove(buf + pb->size, buf, len); @@ -1538,7 +1538,7 @@ window_copy_append_selection(struct window_pane *wp, int idx) len += pb->size; } - if (paste_replace(&global_buffers, idx, buf, len) != 0) + if (paste_replace(idx, buf, len) != 0) free(buf); } |