diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd-paste-buffer.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/paste.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/window-copy.c | 4 |
3 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/tmux/cmd-paste-buffer.c b/usr.bin/tmux/cmd-paste-buffer.c index fc01461bc7b..4147e6a1c25 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.1 2009/06/01 22:58:49 nicm Exp $ */ +/* $OpenBSD: cmd-paste-buffer.c,v 1.2 2009/07/02 16:15:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -63,7 +63,7 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) } } - if (pb != NULL) + if (pb != NULL && *pb->data != '\0') buffer_write(w->active->out, pb->data, strlen(pb->data)); /* Delete the buffer if -d. */ diff --git a/usr.bin/tmux/paste.c b/usr.bin/tmux/paste.c index 2f091406e4c..a76b47eea52 100644 --- a/usr.bin/tmux/paste.c +++ b/usr.bin/tmux/paste.c @@ -1,4 +1,4 @@ -/* $OpenBSD: paste.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */ +/* $OpenBSD: paste.c,v 1.2 2009/07/02 16:15:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -101,6 +101,9 @@ paste_add(struct paste_stack *ps, char *data, u_int limit) { struct paste_buffer *pb; + if (*data == '\0') + return; + while (ARRAY_LENGTH(ps) >= limit) ARRAY_TRUNC(ps, 1); diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index 8a291bfc11c..400738192d7 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.1 2009/06/01 22:58:49 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.2 2009/07/02 16:15:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -423,7 +423,7 @@ window_copy_copy_selection(struct window_pane *wp, struct client *c) /* Find start and end. */ xx = data->cx + data->ox; yy = screen_hsize(&wp->base) + data->cy - data->oy; - if (xx < data->selx || (yy == data->sely && xx < data->selx)) { + if (yy < data->sely || (yy == data->sely && xx < data->selx)) { sx = xx; sy = yy; ex = data->selx; ey = data->sely; } else { |