summaryrefslogtreecommitdiffstats
path: root/cmd-paste-buffer.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-12-30 23:16:18 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-12-30 23:16:18 +0000
commitcc42614fa92a0fd93ae359af6562401a2d3d00d7 (patch)
tree48971a7a344f23f480e8d8aa32c928e1bb537a60 /cmd-paste-buffer.c
parent2231e72968629d67575b18979fed13b4f5ad730b (diff)
Change from a per-session stack of buffers to one global stack which is
much more convenient and also simplifies lot of code. This renders copy-buffer useless and makes buffer-limit now a server option. By Tiago Cunha.
Diffstat (limited to 'cmd-paste-buffer.c')
-rw-r--r--cmd-paste-buffer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd-paste-buffer.c b/cmd-paste-buffer.c
index 75d9373f..439d7190 100644
--- a/cmd-paste-buffer.c
+++ b/cmd-paste-buffer.c
@@ -136,9 +136,10 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
return (-1);
if (data->buffer == -1)
- pb = paste_get_top(&s->buffers);
+ pb = paste_get_top(&global_buffers);
else {
- if ((pb = paste_get_index(&s->buffers, data->buffer)) == NULL) {
+ pb = paste_get_index(&global_buffers, data->buffer);
+ if (pb == NULL) {
ctx->error(ctx, "no buffer %d", data->buffer);
return (-1);
}
@@ -150,9 +151,9 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
/* Delete the buffer if -d. */
if (data->flag_delete) {
if (data->buffer == -1)
- paste_free_top(&s->buffers);
+ paste_free_top(&global_buffers);
else
- paste_free_index(&s->buffers, data->buffer);
+ paste_free_index(&global_buffers, data->buffer);
}
return (0);