summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-set-buffer.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-09-14 12:52:22 +0000
committernicm <nicm@openbsd.org>2015-09-14 12:52:22 +0000
commit566c0f7a082d7722ad1dcaa5f157f0c526ddf36e (patch)
tree40ac06a22c119b5a79766e46a855750d2bc642ff /usr.bin/tmux/cmd-set-buffer.c
parentWrap the remaining __*dtoa() functions so that internal calls go direct (diff)
downloadwireguard-openbsd-566c0f7a082d7722ad1dcaa5f157f0c526ddf36e.tar.xz
wireguard-openbsd-566c0f7a082d7722ad1dcaa5f157f0c526ddf36e.zip
Should add buffer if no -b.
Diffstat (limited to 'usr.bin/tmux/cmd-set-buffer.c')
-rw-r--r--usr.bin/tmux/cmd-set-buffer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-set-buffer.c b/usr.bin/tmux/cmd-set-buffer.c
index d68f01f64b0..78468cbb503 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.22 2015/09/11 14:41:50 nicm Exp $ */
+/* $OpenBSD: cmd-set-buffer.c,v 1.23 2015/09/14 12:52:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -56,11 +56,13 @@ cmd_set_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
bufname = args_get(args, 'b');
if (bufname == NULL)
- pb = paste_get_top(&bufname);
+ pb = NULL;
else
pb = paste_get_name(bufname);
if (self->entry == &cmd_delete_buffer_entry) {
+ if (pb == NULL)
+ pb = paste_get_top(&bufname);
if (pb == NULL) {
cmdq_error(cmdq, "no buffer");
return (CMD_RETURN_ERROR);
@@ -70,6 +72,8 @@ cmd_set_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
}
if (args_has(args, 'n')) {
+ if (pb == NULL)
+ pb = paste_get_top(&bufname);
if (pb == NULL) {
cmdq_error(cmdq, "no buffer");
return (CMD_RETURN_ERROR);