diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2015-09-15 13:57:57 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2015-09-15 13:57:57 +0100 |
commit | 57ad1f6ddf0776a2115b3bf62d58744666b1b283 (patch) | |
tree | 7f0ed40c51abe69141bea82940c2637bd61474a5 /cmd-set-buffer.c | |
parent | 54bd7612868341c47bd3bd237c9598d5860b3ef3 (diff) | |
parent | b5d789a53167552e355848ecfec100cb70b61d97 (diff) | |
download | rtmux-57ad1f6ddf0776a2115b3bf62d58744666b1b283.tar.gz rtmux-57ad1f6ddf0776a2115b3bf62d58744666b1b283.tar.bz2 rtmux-57ad1f6ddf0776a2115b3bf62d58744666b1b283.zip |
Merge branch 'master' of github.com:tmux/tmux
Diffstat (limited to 'cmd-set-buffer.c')
-rw-r--r-- | cmd-set-buffer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd-set-buffer.c b/cmd-set-buffer.c index 01afa774..e7f7627e 100644 --- a/cmd-set-buffer.c +++ b/cmd-set-buffer.c @@ -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); |